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


TypeScript Delay.setTimeout函数代码示例

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


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

示例1: 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:aha-app,项目名称:tinymce-word-paste-filter,代码行数:27,代码来源:EditorManagerTest.ts

示例2: 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:aha-app,项目名称:tinymce-word-paste-filter,代码行数:25,代码来源:Throbber.ts

示例3: 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:aha-app,项目名称:tinymce-word-paste-filter,代码行数:26,代码来源:Window.ts

示例4: 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:aha-app,项目名称:tinymce-word-paste-filter,代码行数:10,代码来源:DelayTest.ts

示例5: 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:aha-app,项目名称:tinymce-word-paste-filter,代码行数:11,代码来源:Menu.ts

示例6: function

      const check = function (time, count) {
        const result = editor.dom.select(selector);

        if (result.length > 0) {
          resolve(result);
        } else {
          if (count === 0) {
            reject();
          } else {
            Delay.setTimeout(function () {
              check(time, count--);
            }, time);
          }
        }
      };
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:15,代码来源:ImagePasteTest.ts

示例7: function

    self.on('postrender show', function (e) {
      if (e.control === self) {
        let $modalBlockEl;
        const prefix = self.classPrefix;

        if (self.modal && !hasModal) {
          $modalBlockEl = DomQuery('#' + prefix + 'modal-block', self.getContainerElm());
          if (!$modalBlockEl[0]) {
            $modalBlockEl = DomQuery(
              '<div id="' + prefix + 'modal-block" class="' + prefix + 'reset ' + prefix + 'fade"></div>'
            ).appendTo(self.getContainerElm());
          }

          Delay.setTimeout(function () {
            $modalBlockEl.addClass(prefix + 'in');
            DomQuery(self.getEl()).addClass(prefix + 'in');
          });

          hasModal = true;
        }

        addRemove(true, self);
      }
    });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:24,代码来源:FloatPanel.ts

示例8: src

  src (src) {
    this.getEl().src = src;
  },

  /**
   * Inner HTML for the iframe.
   *
   * @method html
   * @param {String} html HTML string to set as HTML inside the iframe.
   * @param {function} callback Optional callback to execute when the iframe body is filled with contents.
   * @return {tinymce.ui.Iframe} Current iframe control.
   */
  html (html, callback) {
    const self = this, body = this.getEl().contentWindow.document.body;

    // Wait for iframe to initialize IE 10 takes time
    if (!body) {
      Delay.setTimeout(function () {
        self.html(html);
      });
    } else {
      body.innerHTML = html;

      if (callback) {
        callback();
      }
    }

    return this;
  }
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:31,代码来源:Iframe.ts


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