Skip to content
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...
1 parent 7a29a4a commit bb7edf8bfd749b421daba918b1a0037b55972ab8 @chillu chillu committed Jan 4, 2012
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();
});
}

0 comments on commit bb7edf8

Please sign in to comment.
Something went wrong with that request. Please try again.