當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Delay.requestAnimationFrame函數代碼示例

本文整理匯總了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);
          });
        });
開發者ID:tinymce,項目名稱:tinymce,代碼行數:25,代碼來源:DialogTabHeight.ts

示例2: function

    return function () {
      const execute = function () {
        if (editor.selection) {
          reposition(findFrontMostMatch(editor.selection.getNode()), show);
        }
      };

      Delay.requestAnimationFrame(execute);
    };
開發者ID:abstask,項目名稱:tinymce,代碼行數:9,代碼來源:ContextToolbars.ts

示例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);
          }
        }
      }
    });
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:18,代碼來源:MenuItem.ts

示例4: function

 suite.asyncTest('requestAnimationFrame', function (_, done) {
   Delay.requestAnimationFrame(function () {
     ok(true, 'requestAnimationFrame was executed.');
     done();
   });
 });
開發者ID:abstask,項目名稱:tinymce,代碼行數:6,代碼來源:DelayTest.ts

示例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.
   *
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:30,代碼來源:ReflowQueue.ts


注:本文中的tinymce/core/api/util/Delay.requestAnimationFrame函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。