本文整理汇总了TypeScript中tinymce/core/api/util/Delay.requestAnimationFrame函数的典型用法代码示例。如果您正苦于以下问题:TypeScript requestAnimationFrame函数的具体用法?TypeScript requestAnimationFrame怎么用?TypeScript requestAnimationFrame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requestAnimationFrame函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: measureHeights
SelectorFind.descendant(comp.element(), '[role="tabpanel"]').each((tabview) => {
Css.set(tabview, 'visibility', 'hidden');
// Determine the maximum heights of each tab
comp.getSystem().getByDom(tabview).toOption().each((tabviewComp) => {
const heights = measureHeights(allTabs, tabview, tabviewComp);
// Calculate the maximum tab height and store it
const maxTabHeightOpt = getMaxHeight(heights);
maxTabHeight.set(maxTabHeightOpt);
});
// Set an initial height, based on the current size
updateTabviewHeight(comp.element(), tabview, maxTabHeight);
// Show the tabs
Css.remove(tabview, 'visibility');
showTab(allTabs, comp);
// Use a delay here and recalculate the height, as we need all the components attached
// to be able to properly calculate the max height
Delay.requestAnimationFrame(() => {
updateTabviewHeight(comp.element(), tabview, maxTabHeight);
});
});
开发者ID:tinymce,项目名称:tinymce,代码行数:25,代码来源:DialogTabHeight.ts
示例2: function
return function () {
const execute = function () {
if (editor.selection) {
reposition(findFrontMostMatch(editor.selection.getNode()), show);
}
};
Delay.requestAnimationFrame(execute);
};
开发者ID:abstask,项目名称:tinymce,代码行数:9,代码来源:ContextToolbars.ts
示例3: function
self.on('mouseenter click', function (e) {
if (e.control === self) {
if (!settings.menu && e.type === 'click') {
self.fire('select');
// Edge will crash if you stress it see #2660
Delay.requestAnimationFrame(function () {
self.parent().hideAll();
});
} else {
self.showMenu();
if (e.aria) {
self.menu.focus(true);
}
}
}
});
开发者ID:danielpunkass,项目名称:tinymce,代码行数:18,代码来源:MenuItem.ts
示例4: function
suite.asyncTest('requestAnimationFrame', function (_, done) {
Delay.requestAnimationFrame(function () {
ok(true, 'requestAnimationFrame was executed.');
done();
});
});
开发者ID:abstask,项目名称:tinymce,代码行数:6,代码来源:DelayTest.ts
示例5:
if (!dirtyCtrls[parent._id]) {
dirtyCtrls[parent._id] = parent;
}
if (!animationFrameRequested) {
animationFrameRequested = true;
Delay.requestAnimationFrame(function () {
let id, ctrl;
animationFrameRequested = false;
for (id in dirtyCtrls) {
ctrl = dirtyCtrls[id];
if (ctrl.state.get('rendered')) {
ctrl.reflow();
}
}
dirtyCtrls = {};
}, document.body);
}
}
},
/**
* Removes the specified control from the automatic reflow. This will happen when for example the user
* manually triggers a reflow.
*
开发者ID:danielpunkass,项目名称:tinymce,代码行数:30,代码来源:ReflowQueue.ts
注:本文中的tinymce/core/api/util/Delay.requestAnimationFrame函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论