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


TypeScript Css.setAll方法代码示例

本文整理汇总了TypeScript中@ephox/sugar.Css.setAll方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Css.setAll方法的具体用法?TypeScript Css.setAll怎么用?TypeScript Css.setAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/sugar.Css的用法示例。


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

示例1: function

const takeoverViewport = function (toolbarHeight, height, viewport) {
  const oldViewportStyle = Attr.get(viewport, 'style');

  Scrollable.register(viewport);
  Css.setAll(viewport, {
    position: 'absolute',
    // I think there a class that does this overflow scrolling touch part
    height: height + 'px',
    width: '100%',
    top: toolbarHeight + 'px'
  });

  Attr.set(viewport, yFixedData, toolbarHeight + 'px');
  Attr.set(viewport, yScrollingData, 'true');
  Attr.set(viewport, yFixedProperty, 'top');

  const restore = function () {
    Scrollable.deregister(viewport);
    Attr.set(viewport, 'style', oldViewportStyle || '');
    Attr.remove(viewport, yFixedData);
    Attr.remove(viewport, yScrollingData);
    Attr.remove(viewport, yFixedProperty);
  };

  return {
    restore
  };
};
开发者ID:abstask,项目名称:tinymce,代码行数:28,代码来源:IosViewport.ts

示例2: function

 const make = function (rectangle) {
   const span = Element.fromTag('span');
   Classes.add(span, [ Styles.resolve('layer-editor'), Styles.resolve('unfocused-selection') ]);
   Css.setAll(span, {
     left: rectangle.left() + 'px',
     top: rectangle.top() + 'px',
     width: rectangle.width() + 'px',
     height: rectangle.height() + 'px'
   });
   return span;
 };
开发者ID:abstask,项目名称:tinymce,代码行数:11,代码来源:FakeSelection.ts

示例3: calcPosition

  const setChromePosition = (toolbar) => {
    // We need to always recalculate the toolbar's position so Docking switches between fixed and
    // absolute correctly. Only recalculating when position: absolute breaks transition on window
    // resize behaviour (chrome gets stuck fixed to the top of the viewport).
    const offset = split ? toolbar.fold(() => 0, (tbar) => {
      // If we have an overflow toolbar, we need to offset the positioning by the height of the overflow toolbar
      return tbar.components().length > 1 ? Height.get(tbar.components()[1].element()) : 0;
    }) : 0;
    Css.setAll(floatContainer.element(), calcPosition(offset));

    // Let Docking handle fixed <-> absolute transitions, etc.
    Docking.refresh(floatContainer);
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:Inline.ts

示例4: function

const input = function (parent, operation) {
  // to capture focus allowing the keyboard to remain open with no 'real' selection
  const input = Element.fromTag('input');
  Css.setAll(input, {
    opacity: '0',
    position: 'absolute',
    top: '-1000px',
    left: '-1000px'
  });
  Insert.append(parent, input);

  Focus.focus(input);
  operation(input);
  Remove.remove(input);
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:15,代码来源:CaptureBin.ts

示例5: function

const createContainer = function () {
  const container = Element.fromTag('div');

  Css.setAll(container, {
    position: 'static',
    height: '0',
    width: '0',
    padding: '0',
    margin: '0',
    border: '0'
  });

  Insert.append(Body.body(), container);

  return container;
};
开发者ID:abstask,项目名称:tinymce,代码行数:16,代码来源:TableWire.ts

示例6:

    memContainer.getOpt(anyInSystem).each((panel) => {
      const zoom = zoomState.get();

      const panelW = Width.get(panel.element());
      const panelH = Height.get(panel.element());
      const width = img.dom().naturalWidth * zoom;
      const height = img.dom().naturalHeight * zoom;
      const left = Math.max(0, panelW / 2 - width / 2);
      const top = Math.max(0, panelH / 2 - height / 2);

      const css = {
        left: left.toString() + 'px',
        top: top.toString() + 'px',
        width: width.toString() + 'px',
        height: height.toString() + 'px',
        position: 'absolute'
      };

      Css.setAll(img, css);
      memBg.getOpt(panel).each((bg) => {
        Css.setAll(bg.element(), css);
      });

      cropRect.get().each((cRect) => {
        const rect = rectState.get();
        cRect.setRect({
          x: rect.x * zoom + left,
          y: rect.y * zoom + top,
          w: rect.w * zoom,
          h: rect.h * zoom
        });
        cRect.setClampRect({
          x: left,
          y: top,
          w: width,
          h: height
        });
        cRect.setViewPortRect({
          x: 0,
          y: 0,
          w: panelW,
          h: panelH
        });
      });
    });
开发者ID:tinymce,项目名称:tinymce,代码行数:45,代码来源:ImagePanel.ts

示例7: function

const createIframeElement = function (id, title, height, customAttrs) {
  const iframe = Element.fromTag('iframe');

  Attr.setAll(iframe, customAttrs);

  Attr.setAll(iframe, {
    id: id + '_ifr',
    frameBorder: '0',
    allowTransparency: 'true',
    title
  });

  Css.setAll(iframe, {
    width: '100%',
    height: normalizeHeight(height),
    display: 'block' // Important for Gecko to render the iframe correctly
  });

  return iframe;
};
开发者ID:mdgbayly,项目名称:tinymce,代码行数:20,代码来源:InitIframe.ts

示例8: function

const createIframeElement = function (id, title, height, customAttrs) {
  const iframe = Element.fromTag('iframe');

  Attr.setAll(iframe, customAttrs);

  // Workaround WebKit regression in which findFrameNamed: no longer works to find the TinyMCE editor frame by it's ID,
  // because the frame's name is only considered to be set by the name attribute. See: https://bugs.webkit.org/show_bug.cgi?id=187937
  // Need to define "name" below to accommodate it.
  Attr.setAll(iframe, {
    id: id + '_ifr',
    name: id + '_ifr',
    frameBorder: '0',
    allowTransparency: 'true',
    title
  });

  Css.setAll(iframe, {
    width: '100%',
    height: normalizeHeight(height),
    display: 'block' // Important for Gecko to render the iframe correctly
  });

  return iframe;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:24,代码来源:InitIframe.ts


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