本文整理汇总了TypeScript中tinymce/core/api/dom/DOMUtils.DOM.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DOM.get方法的具体用法?TypeScript DOM.get怎么用?TypeScript DOM.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tinymce/core/api/dom/DOMUtils.DOM
的用法示例。
在下文中一共展示了DOM.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
return function (e) {
const buttonCtrl = this.parent();
let value;
const currentColor = TextColor.getCurrentColor(editor, buttonCtrl.settings.format);
const selectColor = function (value) {
editor.execCommand('mceApplyTextcolor', buttonCtrl.settings.format, value);
buttonCtrl.hidePanel();
buttonCtrl.color(value);
};
const resetColor = function () {
editor.execCommand('mceRemoveTextcolor', buttonCtrl.settings.format);
buttonCtrl.hidePanel();
buttonCtrl.resetColor();
};
if (DOMUtils.DOM.getParent(e.target, '.mce-custom-color-btn')) {
buttonCtrl.hidePanel();
const colorPickerCallback = Settings.getColorPickerCallback(editor);
colorPickerCallback.call(editor, function (value) {
const tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
let customColorCells, div, i;
customColorCells = Tools.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) {
return elm.firstChild;
});
for (i = 0; i < customColorCells.length; i++) {
div = customColorCells[i];
if (!div.getAttribute('data-mce-color')) {
break;
}
}
// Shift colors to the right
// TODO: Might need to be the left on RTL
if (i === cols) {
for (i = 0; i < cols - 1; i++) {
setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
}
}
setDivColor(div, value);
selectColor(value);
}, currentColor);
}
value = e.target.getAttribute('data-mce-color');
if (value) {
if (this.lastId) {
DOMUtils.DOM.get(this.lastId).setAttribute('aria-selected', 'false');
}
e.target.setAttribute('aria-selected', true);
this.lastId = e.target.id;
if (value === 'transparent') {
resetColor();
} else {
selectColor(value);
}
} else if (value !== null) {
buttonCtrl.hidePanel();
}
};
示例2: function
Pipeline.async({}, suite.toSteps({}), function () {
EventUtils.Event.clean(viewBlock.get());
DOMUtils.DOM.remove(DOMUtils.DOM.get('mce-modal-block'));
viewBlock.detach();
success();
}, failure);