當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。