我试图将以下属性添加到我在链接插件对话框中单击“确定”后创建的元素
style="color:#1cb9b0"
不确定我将在onOk函数中添加属性的位置?目前是
onOk: function () {
var data = {};
// Collect data from fields.
this.commitContent(data);
if (!this._.selectedElements.length) {
insertLinksIntoSelection(editor, data);
} else {
editLinksInSelection(editor, this._.selectedElements, data);
delete this._.selectedElements;
}
},
任何提示或提示都会很棒。
答案 0 :(得分:0)
因此,建议在插入或编辑现有链接时,我可以在那里添加样式属性。
在insertLinksIntoSelection
和editLinksInSelection
函数中,我添加了以下行
attributes.set.style = "color: #1cb9b0;"; // add style attribute
工作得很好。