当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Delay.setTimeout函数代码示例

本文整理汇总了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;未经允许,请勿转载。