本文整理汇总了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);
示例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;
};
示例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 };
};
示例4: function
const getComputedSizeProp = function (propName, elm) {
return parseInt(Css.get(elm, propName), 10);
};
示例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;
};
示例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);
示例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;
};
示例8:
return inline.getOrThunk(function () {
return Css.get(start, 'font-size');
});
示例9: isPreValue
.exists((elm) => isPreValue(Css.get(elm, 'white-space')));
示例10:
const isImageBlock = (node: Node) => {
return node.nodeName === 'IMG' && Css.get(Element.fromDom(node), 'display') === 'block';
};