• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript Delay.setTimeout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中tinymce/core/api/util/Delay.setTimeout函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setTimeout函数的具体用法?TypeScript setTimeout怎么用?TypeScript setTimeout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setTimeout函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

    editor.settings.images_upload_handler = function (data, success, failure) {
      uploadCount++;

      Delay.setTimeout(function () {
        failure('Error');
      }, 0);
    };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:EditorUploadTest.ts


示例2: function

  suite.asyncTest('Externally destroyed editor', function (_, done) {
    EditorManager.remove();

    EditorManager.init({
      selector: 'textarea',
      skin_url: '/project/js/tinymce/skins/lightgray',
      init_instance_callback (editor1) {
        Delay.setTimeout(function () {
          // Destroy the editor by setting innerHTML common ajax pattern
          viewBlock.update('<textarea id="' + editor1.id + '"></textarea>');

          // Re-init the editor will have the same id
          EditorManager.init({
            selector: 'textarea',
            skin_url: '/project/js/tinymce/skins/lightgray',
            init_instance_callback (editor2) {
              LegacyUnit.equal(EditorManager.get().length, 1);
              LegacyUnit.equal(editor1.id, editor2.id);
              LegacyUnit.equal(editor1.destroyed, 1, 'First editor instance should be destroyed');

              teardown(done);
            }
          });
        }, 0);
      }
    });
  });
开发者ID:abstask,项目名称:tinymce,代码行数:27,代码来源:EditorManagerTest.ts


示例3: function

  self.show = function (time, callback) {
    function render() {
      if (state) {
        $(elm).append(
          '<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>'
        );

        if (callback) {
          callback();
        }
      }
    }

    self.hide();

    state = true;

    if (time) {
      timer = Delay.setTimeout(render, time);
    } else {
      render();
    }

    return self;
  };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:25,代码来源:Throbber.ts


示例4:

        onAction: (api, _actionData) => {
          Delay.setTimeout(() => {
            const currentData = api.getData();
            store.adder('currentData: ' + currentData.fieldA)();
            // Currently, this will be ignored once the dialog is closed.
            api.setData({
              fieldA: 'New Value'
            });

            // Check all APIs do not throw errors
            api.disable('async.setData');
            api.enable('async.setData');
            api.block('message');
            api.unblock();
            api.showTab('new tab');
            // Currently, it is only going to validate it if the dialog is still open
            api.redial({
              title: 'temporary redial to check the API',
              body: {
                type: 'panel',
                items: []
              },
              buttons: []
            });
            api.close();

            store.adder('newData: ' + currentData.fieldA)();
          }, 2000);
        }
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:SilverDialogApiAccessTest.ts


示例5: done

const fallback = (editor: Editor): FallbackFn => (html, done) => {
  const markedHtml = InternalHtml.mark(html);
  const outer = editor.dom.create('div', {
    'contenteditable': 'false',
    'data-mce-bogus': 'all'
  });
  const inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml);
  editor.dom.setStyles(outer, {
    position: 'fixed',
    top: '0',
    left: '-3000px',
    width: '1000px',
    overflow: 'hidden'
  });
  outer.appendChild(inner);
  editor.dom.add(editor.getBody(), outer);

  const range = editor.selection.getRng();
  inner.focus();

  const offscreenRange: Range = editor.dom.createRng();
  offscreenRange.selectNodeContents(inner);
  editor.selection.setRng(offscreenRange);

  Delay.setTimeout(() => {
    editor.selection.setRng(range);
    outer.parentNode.removeChild(outer);
    done();
  }, 0);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:30,代码来源:CutCopy.ts


示例6: DomQuery

      DomQuery(window).on('resize', function () {
        let time;

        if (self._fullscreen) {
          // Time the layout time if it's to slow use a timeout to not hog the CPU
          if (!slowRendering) {
            time = new Date().getTime();

            const rect = DomUtils.getWindowSize();
            self.moveTo(0, 0).resizeTo(rect.w, rect.h);

            if ((new Date().getTime()) - time > 50) {
              slowRendering = true;
            }
          } else {
            if (!self._timer) {
              self._timer = Delay.setTimeout(function () {
                const rect = DomUtils.getWindowSize();
                self.moveTo(0, 0).resizeTo(rect.w, rect.h);

                self._timer = 0;
              }, 50);
            }
          }
        }
      });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:26,代码来源:Window.ts


示例7: setClipboardData

 setClipboardData(evt, getData(editor), fallback(editor), () => {
   // Chrome fails to execCommand from another execCommand with this message:
   // "We don't execute document.execCommand() this time, because it is called recursively.""
   Delay.setTimeout(() => { // detach
     editor.execCommand('Delete');
   }, 0);
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:CutCopy.ts


示例8: function

  suite.test('clearTimeout', function () {
    let id;

    id = Delay.setTimeout(function () {
      throw new Error('clearTimeout didn\'t work.');
    });

    Delay.clearTimeout(id);
    ok(true, 'clearTimeout works.');
  });
开发者ID:abstask,项目名称:tinymce,代码行数:10,代码来源:DelayTest.ts


示例9: function

 self.on('show hide', function (e) {
   if (e.control === self) {
     if (e.type === 'show') {
       Delay.setTimeout(function () {
         self.classes.add('in');
       }, 0);
     } else {
       self.classes.remove('in');
     }
   }
 });
开发者ID:abstask,项目名称:tinymce,代码行数:11,代码来源:Menu.ts



注:本文中的tinymce/core/api/util/Delay.setTimeout函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript Delay.throttle函数代码示例发布时间:2022-05-25
下一篇:
TypeScript Delay.setInterval函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap