如何解决tinymce 5.6.2 的动态对话框
在使用 tinymce 4.x 时,我使用了对话框实例 API 提供的 find() 函数来动态操作对话框所包含的元素(请参阅底部的示例)。然而,它接缝在tinymce 5 中删除了find() 函数。是否有另一种方法来动态操作对话框元素?在没有替代方案的情况下删除 find() 函数在逻辑上是不合逻辑的。
const otAFTContainer = win.find('#order_types_and_afts')[0];
let newItemNr = 0;
let doReflow = false;
tinymce.each(otAFTContainer.items().slice(0),function(existingItem: TinyMCEControl) {
if (newItemNr < otAFTitems.length) {
const ctrl = otAFTContainer.create(otAFTitems[newItemNr++])[0];
otAFTContainer.replace(existingItem,ctrl);
} else if (removeExtraRemaining) {
// The new list is definitive: remove any remaining existing items after its end
existingItem.remove();
} else {
otAFTContainer.replace(existingItem,otAFTContainer.create({
type: 'label',label: '\u00a0',items: []
})[0]);
}
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。