本文整理匯總了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);
});
});
示例2: function
return function () {
const execute = function () {
if (editor.selection) {
reposition(findFrontMostMatch(editor.selection.getNode()), show);
}
};
Delay.requestAnimationFrame(execute);
};
示例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);
}
}
}
});
示例4: function
suite.asyncTest('requestAnimationFrame', function (_, done) {
Delay.requestAnimationFrame(function () {
ok(true, 'requestAnimationFrame was executed.');
done();
});
});
示例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.
*