mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX TinyMCE context menu displaying default dialogs instead of our one
This commit is contained in:
parent
6f937745b0
commit
4681673896
@ -39,6 +39,19 @@
|
||||
jQuery('#' + this.id).entwine('ss').openMediaDialog();
|
||||
});
|
||||
|
||||
// Replace the mceAdvLink and mceLink commands with the sslink command, and
|
||||
// the mceAdvImage and mceImage commands with the ssmedia command
|
||||
ed.onBeforeExecCommand.add(function(ed, cmd, ui, val, a){
|
||||
if (cmd == 'mceAdvLink' || cmd == 'mceLink'){
|
||||
ed.execCommand('sslink', ui, val, a);
|
||||
a.terminate = true;
|
||||
}
|
||||
else if (cmd == 'mceAdvImage' || cmd == 'mceImage'){
|
||||
ed.execCommand('ssmedia', ui, val, a);
|
||||
a.terminate = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Disable link button when no link is selected
|
||||
ed.onNodeChange.add(function(ed, cm, n, co) {
|
||||
cm.setDisabled('sslink', co && n.nodeName != 'A');
|
||||
|
Loading…
Reference in New Issue
Block a user