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


TypeScript snooker.TableResize函數代碼示例

本文整理匯總了TypeScript中@ephox/snooker.TableResize函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript TableResize函數的具體用法?TypeScript TableResize怎麽用?TypeScript TableResize使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了TableResize函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

  editor.on('init', function () {
    const direction = TableDirection(Direction.directionAt);
    const rawWire = TableWire.get(editor);
    wire = Option.some(rawWire);
    if (hasObjectResizing(editor) && hasTableResizeBars(editor)) {
      const sz = TableResize(rawWire, direction);
      sz.on();
      sz.events.startDrag.bind(function (event) {
        selectionRng = Option.some(editor.selection.getRng());
      });

      sz.events.beforeResize.bind(function (event) {
        const rawTable = event.table().dom();
        Events.fireObjectResizeStart(editor, rawTable, Util.getPixelWidth(rawTable), Util.getPixelHeight(rawTable));
      });

      sz.events.afterResize.bind(function (event) {
        const table = event.table();
        const rawTable = table.dom();
        Util.removeDataStyle(table);

        selectionRng.each(function (rng) {
          editor.selection.setRng(rng);
          editor.focus();
        });

        Events.fireObjectResized(editor, rawTable, Util.getPixelWidth(rawTable), Util.getPixelHeight(rawTable));
        editor.undoManager.add();
      });

      resize = Option.some(sz);
    }
  });
開發者ID:tinymce,項目名稱:tinymce,代碼行數:33,代碼來源:ResizeHandler.ts

示例2: function

  editor.on('init', function () {
    const direction = TableDirection(Direction.directionAt);
    const rawWire = TableWire.get(editor);
    wire = Option.some(rawWire);
    if (editor.settings.object_resizing && editor.settings.table_resize_bars !== false &&
      (editor.settings.object_resizing === true || editor.settings.object_resizing === 'table')) {
      const sz = TableResize(rawWire, direction);
      sz.on();
      sz.events.startDrag.bind(function (event) {
        selectionRng = Option.some(editor.selection.getRng());
      });
      sz.events.afterResize.bind(function (event) {
        const table = event.table();
        const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
        Arr.each(dataStyleCells, function (cell) {
          Attr.remove(cell, 'data-mce-style');
        });

        selectionRng.each(function (rng) {
          editor.selection.setRng(rng);
          editor.focus();
        });

        editor.undoManager.add();
      });

      resize = Option.some(sz);
    }
  });
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:29,代碼來源:ResizeHandler.ts


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