本文整理汇总了TypeScript中@ephox/alloy.Gui.takeover方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Gui.takeover方法的具体用法?TypeScript Gui.takeover怎么用?TypeScript Gui.takeover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/alloy.Gui
的用法示例。
在下文中一共展示了Gui.takeover方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
export default function (spec) {
const root = GuiFactory.build(
Container.sketch({
dom: {
classes: [ Styles.resolve('outer-container') ].concat(spec.classes)
},
containerBehaviours: Behaviour.derive([
Swapping.config({
alpha: READ_ONLY_MODE_CLASS(),
omega: EDIT_MODE_CLASS()
})
])
})
);
return Gui.takeover(root);
}
示例2: onEscape
//.........这里部分代码省略.........
...I18n.isRtl() ? { dir: 'rtl' } : {}
};
const outerContainer = GuiFactory.build(
OuterContainer.sketch({
dom: {
tag: 'div',
classes: ['tox', 'tox-tinymce'].concat(isInline ? ['tox-tinymce-inline'] : []),
styles: {
// This is overridden by the skin, it helps avoid FOUC
visibility: 'hidden'
},
attributes
},
components: containerComponents,
behaviours: Behaviour.derive(mode.getBehaviours(editor).concat([
Keying.config({
mode: 'cyclic',
selector: '.tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a'
})
]))
} as OuterContainerSketchSpec)
);
lazyOuterContainer = Option.some(outerContainer);
editor.shortcuts.add('alt+F9', 'focus menubar', function () {
OuterContainer.focusMenubar(outerContainer);
});
editor.shortcuts.add('alt+F10', 'focus toolbar', function () {
OuterContainer.focusToolbar(outerContainer);
});
const mothership = Gui.takeover(
outerContainer
);
const uiMothership = Gui.takeover(sink);
Events.setup(editor, mothership, uiMothership);
const getUi = () => {
const channels = {
broadcastAll: uiMothership.broadcast,
broadcastOn: uiMothership.broadcastOn,
register: () => {}
};
return { channels };
};
const setEditorSize = (elm) => {
// Set height and width if they were given, though height only applies to iframe mode
const DOM = DOMUtils.DOM;
const baseWidth = editor.getParam('width', DOM.getStyle(elm, 'width'));
const baseHeight = getHeightSetting(editor);
const minWidth = getMinWidthSetting(editor);
const minHeight = getMinHeightSetting(editor);
const parsedWidth = Utils.parseToInt(baseWidth).bind((w) => {
return Utils.numToPx(minWidth.map((mw) => Math.max(w, mw)));
}).getOr(Utils.numToPx(baseWidth));
const parsedHeight = Utils.parseToInt(baseHeight).bind((h) => {
return minHeight.map((mh) => Math.max(h, mh));