本文整理汇总了TypeScript中@ephox/sugar.Width类的典型用法代码示例。如果您正苦于以下问题:TypeScript Width类的具体用法?TypeScript Width怎么用?TypeScript Width使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Width类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1:
return Step.sync(function () {
const element = Hierarchy.follow(Element.fromDom(editor.getBody()), path).getOrDie('could not find element');
const height = Height.get(element);
const width = Width.get(element);
state.set({
h: height,
w: width
});
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:10,代码来源:DragResizeTest.ts
示例2:
return Logger.t('Set height and width', Step.sync(() => {
const element = Hierarchy.follow(Element.fromDom(editor.getBody()), path).getOrDie('could not find element');
const height = Height.get(element);
const width = Width.get(element);
state.set({
h: height,
w: width
});
}));
开发者ID:tinymce,项目名称:tinymce,代码行数:10,代码来源:DragResizeTest.ts
示例3: looseEqual
return Step.sync(function () {
const element = Hierarchy.follow(Element.fromDom(editor.getBody()), path).getOrDie('could not find element');
const height = Height.get(element);
const width = Width.get(element);
const changedHeight = state.get().h + change.dh;
const changedWidth = state.get().w + change.dw;
Assertions.assertEq('height has changed as expected', true, looseEqual(changedHeight, height, 2));
Assertions.assertEq('width has changed as expected', true, looseEqual(changedWidth, width, 2));
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:11,代码来源:DragResizeTest.ts
示例4: looseEqual
return Logger.t('Asset change in height and width', Step.sync(() => {
const element = Hierarchy.follow(Element.fromDom(editor.getBody()), path).getOrDie('could not find element');
const height = Height.get(element);
const width = Width.get(element);
const changedHeight = state.get().h + change.dh;
const changedWidth = state.get().w + change.dw;
Assertions.assertEq('height is ' + height + ' but expected ' + changedHeight, true, looseEqual(changedHeight, height, 4));
Assertions.assertEq('width is ' + width + ' but expected ' + changedWidth, true, looseEqual(changedWidth, width, 4));
}));
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:DragResizeTest.ts
示例5:
AlloyEvents.run<ChangeSlideEvent>(changeSlideEvent, (comp, se) => {
// If it was partially through a slide, clear that and measure afresh
Css.remove(comp.element(), 'width');
const currentWidth = Width.get(comp.element());
InlineView.setContent(comp, se.event().contents());
Class.add(comp.element(), resizingClass);
const newWidth = Width.get(comp.element());
Css.set(comp.element(), 'width', currentWidth + 'px');
InlineView.getContent(comp).each((newContents) => {
se.event().focus().bind((f) => {
Focus.focus(f);
return Focus.search(comp.element());
}).orThunk(() => {
Keying.focusIn(newContents);
return Focus.active();
});
});
Delay.setTimeout(() => {
Css.set(comp.element(), 'width', newWidth + 'px');
}, 0);
}),
开发者ID:tinymce,项目名称:tinymce,代码行数:22,代码来源:ContextUi.ts
示例6:
memContainer.getOpt(anyInSystem).each((panel) => {
const panelW = Width.get(panel.element());
const panelH = Height.get(panel.element());
const width = img.dom().naturalWidth;
const height = img.dom().naturalHeight;
const zoom = Math.min((panelW) / width, (panelH) / height);
if (zoom >= 1) {
zoomState.set(1);
} else {
zoomState.set(zoom);
}
});
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:ImagePanel.ts
示例7: parseInt
Css.getRaw(parent, 'left').each(function (left) {
const currentLeft = parseInt(left, 10);
const w = Width.get(screens[0]);
Css.set(parent, 'left', (currentLeft - (direction * w)) + 'px');
});
开发者ID:tinymce,项目名称:tinymce,代码行数:5,代码来源:SerialisedDialog.ts
示例8:
onStartShrink: (slider: AlloyComponent) => {
AlloyTriggers.emitWith(slider, fixSize, { width: Width.get(slider.element()) + 'px' });
}
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:Sidebar.ts
示例9: function
const sketch = function (settings) {
const dataset = convert(settings.formats, function () {
return memMenu;
});
// Turn settings into a tiered menu data.
const memMenu = Memento.record(TieredMenu.sketch({
dom: {
tag: 'div',
classes: [ Styles.resolve('styles-menu') ]
},
components: [ ],
// Focus causes issues when the things being focused are offscreen.
fakeFocus: true,
// For animations, need things to stay around in the DOM (at least until animation is done)
stayInDom: true,
onExecute (tmenu, item) {
const v = Representing.getValue(item);
settings.handle(item, v.value);
},
onEscape () {
},
onOpenMenu (container, menu) {
const w = Width.get(container.element());
Width.set(menu.element(), w);
Transitioning.jumpTo(menu, 'current');
},
onOpenSubmenu (container, item, submenu) {
const w = Width.get(container.element());
const menu = SelectorFind.ancestor(item.element(), '[role="menu"]').getOrDie('hacky');
const menuComp = container.getSystem().getByDom(menu).getOrDie();
Width.set(submenu.element(), w);
Transitioning.progressTo(menuComp, 'before');
Transitioning.jumpTo(submenu, 'after');
Transitioning.progressTo(submenu, 'current');
},
onCollapseMenu (container, item, menu) {
const submenu = SelectorFind.ancestor(item.element(), '[role="menu"]').getOrDie('hacky');
const submenuComp = container.getSystem().getByDom(submenu).getOrDie();
Transitioning.progressTo(submenuComp, 'after');
Transitioning.progressTo(menu, 'current');
},
navigateOnHover: false,
openImmediately: true,
data: dataset.tmenu,
markers: {
backgroundMenu: Styles.resolve('styles-background-menu'),
menu: Styles.resolve('styles-menu'),
selectedMenu: Styles.resolve('styles-selected-menu'),
item: Styles.resolve('styles-item'),
selectedItem: Styles.resolve('styles-selected-item')
}
}));
return memMenu.asSpec();
};
开发者ID:abstask,项目名称:tinymce,代码行数:64,代码来源:StylesMenu.ts
注:本文中的@ephox/sugar.Width类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论