Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT Marking "link" and "unlink" buttons in SilverStripe's Tin…

…yMCE as disabled if no link is selected (see 4646efe84 in sapphire for details)
  • Loading branch information...
commit bb7edf8bfd749b421daba918b1a0037b55972ab8 1 parent 7a29a4a
@chillu chillu authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 javascript/tinymce_ssbuttons/editor_plugin_src.js
View
6 javascript/tinymce_ssbuttons/editor_plugin_src.js
@@ -37,8 +37,10 @@
jQuery('#Form_EditorToolbarFlashForm')[0].open();
});
- ed.onNodeChange.add(function(ed, o) {
- jQuery('Form_EditorToolbarLinkForm').entwine('ss').updateSelection();
+ ed.onNodeChange.add(function(ed, cm, n, co) {
+ cm.setDisabled('sslink', co && n.nodeName != 'A');
+ cm.setActive('sslink', n.nodeName == 'A' && !n.name);
+
jQuery('Form_EditorToolbarLinkForm').entwine('ss').respondToNodeChange();
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.