OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
mobile
/
main
/
ts
/
ios
/
view
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:36:33 AM
rwxr-xr-x
📄
DeviceZones.ts
2.75 KB
02/20/2020 06:36:36 AM
rw-r--r--
📄
Devices.ts
1.62 KB
02/20/2020 06:36:36 AM
rw-r--r--
📄
Greenzone.ts
980 bytes
02/20/2020 06:36:37 AM
rw-r--r--
📄
IosKeyboard.ts
4.86 KB
02/20/2020 06:36:37 AM
rw-r--r--
📄
IosUpdates.ts
1.59 KB
02/20/2020 06:36:38 AM
rw-r--r--
📄
IosViewport.ts
5.89 KB
02/20/2020 06:36:38 AM
rw-r--r--
Editing: IosUpdates.ts
Close
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ import { Arr, Future, Futures } from '@ephox/katamari'; import { Css } from '@ephox/sugar'; import IosScrolling from '../scroll/IosScrolling'; import IosViewport from './IosViewport'; const updateFixed = function (element, property, winY, offsetY) { const destination = winY + offsetY; Css.set(element, property, destination + 'px'); return Future.pure(offsetY); }; const updateScrollingFixed = function (element, winY, offsetY) { const destTop = winY + offsetY; const oldProp = Css.getRaw(element, 'top').getOr(offsetY); // While we are changing top, aim to scroll by the same amount to keep the cursor in the same location. const delta = destTop - parseInt(oldProp, 10); const destScroll = element.dom().scrollTop + delta; return IosScrolling.moveScrollAndTop(element, destScroll, destTop); }; const updateFixture = function (fixture, winY) { return fixture.fold(function (element, property, offsetY) { return updateFixed(element, property, winY, offsetY); }, function (element, offsetY) { return updateScrollingFixed(element, winY, offsetY); }); }; const updatePositions = function (container, winY) { const fixtures = IosViewport.findFixtures(container); const updates = Arr.map(fixtures, function (fixture) { return updateFixture(fixture, winY); }); return Futures.par(updates); }; export default { updatePositions };