是的,您可以这样做。
您将需要使用JS文件创建一个自定义客户端库,该文件在工具栏中注册按钮:
(function ($document, author) {
var openDialog = {
icon: 'coral-Icon--game',
text: 'Open Dialog',
handler: function (editable, param, target) {
author.DialogFrame.openDialog(new author.edit.Dialog(editable));
},
condition: function (editable) {
//show this action only for component type eaem-touchui-open-comp-dialog-register-action/touchui-open-component-dialog
return editable.type === "eaem-touchui-open-comp-dialog-register-action/touchui-open-component-dialog";
},
isNonMulti: true
};
$document.on('cq-layer-activated', function (ev) {
if (ev.layer === 'Edit') {
author.EditorFrame.editableToolbar.registerAction('EAEM_OPEN_DIALOG', openDialog);
}
});
})($(document), Granite.author);
您可以自定义图标,文本,按钮的行为,并确定此工具栏自定义将在哪些组件中可见。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句