本文整理汇总了TypeScript中@ephox/katamari.Singleton.value方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Singleton.value方法的具体用法?TypeScript Singleton.value怎么用?TypeScript Singleton.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/katamari.Singleton
的用法示例。
在下文中一共展示了Singleton.value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
FieldSchema.state('state', function () {
return {
dialogSwipeState: Singleton.value(),
currentScreen: Cell(0)
};
})
示例2: function
const create = function (platform, mask) {
const meta = MetaViewport.tag();
const priorState = Singleton.value();
const scrollEvents = Singleton.value();
const iosApi = Singleton.api();
const iosEvents = Singleton.api();
const enter = function () {
mask.hide();
const doc = Element.fromDom(document);
PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) {
// TODO: Orientation changes.
// orientation = Orientation.onChange();
priorState.set({
socketHeight: Css.getRaw(platform.socket, 'height'),
iframeHeight: Css.getRaw(editorApi.frame(), 'height'),
outerScroll: document.body.scrollTop
});
scrollEvents.set({
// Allow only things that have scrollable class to be scrollable. Without this,
// the toolbar scrolling gets prevented
exclusives: Scrollables.exclusive(doc, '.' + Scrollable.scrollable())
});
Class.add(platform.container, Styles.resolve('fullscreen-maximized'));
Thor.clobberStyles(platform.container, editorApi.body());
meta.maximize();
/* NOTE: Making the toolbar scrollable is now done when the middle group is created */
Css.set(platform.socket, 'overflow', 'scroll');
Css.set(platform.socket, '-webkit-overflow-scrolling', 'touch');
Focus.focus(editorApi.body());
const setupBag = Struct.immutableBag([
'cWin',
'ceBody',
'socket',
'toolstrip',
'toolbar',
'dropup',
'contentElement',
'cursor',
'keyboardType',
'isScrolling',
'outerWindow',
'outerBody'
], []);
iosApi.set(
IosSetup.setup(setupBag({
cWin: editorApi.win(),
ceBody: editorApi.body(),
socket: platform.socket,
toolstrip: platform.toolstrip,
toolbar: platform.toolbar,
dropup: platform.dropup.element(),
contentElement: editorApi.frame(),
cursor: Fun.noop,
outerBody: platform.body,
outerWindow: platform.win,
keyboardType: IosKeyboard.stubborn,
isScrolling () {
return scrollEvents.get().exists(function (s) {
return s.socket.isScrolling();
});
}
}))
);
iosApi.run(function (api) {
api.syncHeight();
});
iosEvents.set(
IosEvents.initEvents(editorApi, iosApi, platform.toolstrip, platform.socket, platform.dropup)
);
});
};
const exit = function () {
meta.restore();
iosEvents.clear();
iosApi.clear();
mask.show();
priorState.on(function (s) {
s.socketHeight.each(function (h) {
Css.set(platform.socket, 'height', h);
});
s.iframeHeight.each(function (h) {
Css.set(platform.editor.getFrame(), 'height', h);
});
document.body.scrollTop = s.scrollTop;
//.........这里部分代码省略.........