本文整理汇总了TypeScript中tinymce/core/util/Delay.requestAnimationFrame函数的典型用法代码示例。如果您正苦于以下问题:TypeScript requestAnimationFrame函数的具体用法?TypeScript requestAnimationFrame怎么用?TypeScript requestAnimationFrame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requestAnimationFrame函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
return function () {
const execute = function () {
if (editor.selection) {
reposition(findFrontMostMatch(editor.selection.getNode()), show);
}
};
Delay.requestAnimationFrame(execute);
};
示例2: 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);
}
}
}
});
示例3:
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.
*
示例4: function
suite.asyncTest('requestAnimationFrame', function (_, done) {
Delay.requestAnimationFrame(function () {
ok(true, 'requestAnimationFrame was executed.');
done();
});
});