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


TypeScript Css.get方法代码示例

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


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

示例1: fireEvents

 return SelectorFind.descendant(Util.getBody(editor), 'table[data-mce-id="__mce"]').map((table) => {
   if (isPixelsForced(editor)) {
     Css.set(table, 'width', Css.get(table, 'width'));
   }
   Attr.remove(table, 'data-mce-id');
   fireEvents(editor, table);
   selectFirstCellInTable(editor, table);
   return table.dom();
 }).getOr(null);
开发者ID:abstask,项目名称:tinymce,代码行数:9,代码来源:InsertTable.ts

示例2:

const getMaxTabviewHeight = (dialog: Element, dialogBody: Element) => {
  const rootElm = SelectorFind.ancestor(dialog, '.tox-dialog-wrap').getOr(dialog);
  const isFixed = Css.get(rootElm, 'position') === 'fixed';
  // Get the document or window/viewport height
  let maxHeight;
  if (isFixed) {
    maxHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
  } else {
    maxHeight = Math.max(document.documentElement.offsetHeight, document.documentElement.scrollHeight);
  }
  // Determine the max dialog body height
  const dialogChrome = dialog.dom().getBoundingClientRect().height - dialogBody.dom().getBoundingClientRect().height;
  return maxHeight - dialogChrome;
};
开发者ID:tinymce,项目名称:tinymce,代码行数:14,代码来源:DialogTabHeight.ts

示例3: function

const getPos = function (body, elm, rootElm) {
  let x = 0, y = 0, offsetParent;
  const doc = body.ownerDocument;
  let pos;

  rootElm = rootElm ? rootElm : body;

  if (elm) {
    // Use getBoundingClientRect if it exists since it's faster than looping offset nodes
    // Fallback to offsetParent calculations if the body isn't static better since it stops at the body root
    if (rootElm === body && elm.getBoundingClientRect && Css.get(Element.fromDom(body), 'position') === 'static') {
      pos = elm.getBoundingClientRect();

      // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
      // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
      x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - doc.documentElement.clientLeft;
      y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - doc.documentElement.clientTop;

      return { x, y };
    }

    offsetParent = elm;
    while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType) {
      x += offsetParent.offsetLeft || 0;
      y += offsetParent.offsetTop || 0;
      offsetParent = offsetParent.offsetParent;
    }

    offsetParent = elm.parentNode;
    while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType) {
      x -= offsetParent.scrollLeft || 0;
      y -= offsetParent.scrollTop || 0;
      offsetParent = offsetParent.parentNode;
    }

    y += getTableCaptionDeltaY(Element.fromDom(elm));
  }

  return { x, y };
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:40,代码来源:Position.ts

示例4: function

const getComputedSizeProp = function (propName, elm) {
  return parseInt(Css.get(elm, propName), 10);
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:3,代码来源:EditorView.ts

示例5: function

const matchColor = function (editorBody) {
  // in iOS you can overscroll, sometimes when you overscroll you can reveal the bgcolor of an element beneath,
  // by matching the bg color and clobbering ensures any reveals are 'camouflaged' the same color
  const color = Css.get(editorBody, 'background-color');
  return (color !== undefined && color !== '') ? 'background-color:' + color + '!important' : bgFallback;
};
开发者ID:abstask,项目名称:tinymce,代码行数:6,代码来源:Thor.ts

示例6:

 return Waiter.sTryUntil('Wait background css to be applied to first element', Step.sync(function () {
   const p = Element.fromDom(editor.getBody().firstChild);
   const background = Css.get(p, 'background-image');
   Assertions.assertEq('Paragraph should have a url background', true, background.indexOf('url(') === 0);
 }), 10, 10000);
开发者ID:danielpunkass,项目名称:tinymce,代码行数:5,代码来源:PreviewFormatTest.ts

示例7: isTable

const getIndentStyleName = (useMargin: boolean, element: Element) => {
  const indentStyleName = useMargin || isTable(element) ? 'margin' : 'padding';
  const suffix = Css.get(element, 'direction') === 'rtl' ? '-right' : '-left';
  return indentStyleName + suffix;
};
开发者ID:tinymce,项目名称:tinymce,代码行数:5,代码来源:IndentOutdent.ts

示例8:

 return inline.getOrThunk(function () {
   return Css.get(start, 'font-size');
 });
开发者ID:abstask,项目名称:tinymce,代码行数:3,代码来源:FontSizes.ts

示例9: isPreValue

 .exists((elm) => isPreValue(Css.get(elm, 'white-space')));
开发者ID:danielpunkass,项目名称:tinymce,代码行数:1,代码来源:Nbsps.ts

示例10:

const isImageBlock = (node: Node) => {
  return node.nodeName === 'IMG' && Css.get(Element.fromDom(node), 'display') === 'block';
};
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:CaretPositionPredicates.ts


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