From 7a29a4a0ca5c9561fc08bc87636dd70185f8a905 Mon Sep 17 00:00:00 2001
From: Ingo Schommer <ingo@silverstripe.com>
Date: Wed, 4 Jan 2012 18:06:22 +0100
Subject: [PATCH] MINOR Using entwine calls in ssbuttons TinyMCE plugin

---
 javascript/tinymce_ssbuttons/editor_plugin_src.js | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/javascript/tinymce_ssbuttons/editor_plugin_src.js b/javascript/tinymce_ssbuttons/editor_plugin_src.js
index 60248504..cfeeebd1 100644
--- a/javascript/tinymce_ssbuttons/editor_plugin_src.js
+++ b/javascript/tinymce_ssbuttons/editor_plugin_src.js
@@ -20,14 +20,13 @@
 			};
 		},
 
-
 		init : function(ed, url) {
 			ed.addButton('sslink', {title : ed.getLang('tinymce_ssbuttons.insertlink'), cmd : 'sslink', 'class' : 'mce_link'}); 
 			ed.addButton('ssimage', {title : ed.getLang('tinymce_ssbuttons.insertimage'), cmd : 'ssimage', 'class' : 'mce_image'}); 
 			ed.addButton('ssflash', {title : ed.getLang('tinymce_ssbuttons.insertflash'), cmd : 'ssflash', 'class' : 'mce_flash', 'image': url + '/img/flash.gif'}); 
 
 			ed.addCommand("sslink", function(ed) {
-				jQuery('#Form_EditorToolbarLinkForm')[0].open();
+				jQuery('#Form_EditorToolbarLinkForm').entwine('ss').open();
 			});
 
 			ed.addCommand("ssimage", function(ed) {
@@ -39,15 +38,12 @@
 			});
 			
 			ed.onNodeChange.add(function(ed, o) {
-				if ($('Form_EditorToolbarLinkForm').updateSelection) {
-					$('Form_EditorToolbarLinkForm').updateSelection(ed);
-					$('Form_EditorToolbarLinkForm').respondToNodeChange(ed);
-				}
+				jQuery('Form_EditorToolbarLinkForm').entwine('ss').updateSelection();
+				jQuery('Form_EditorToolbarLinkForm').entwine('ss').respondToNodeChange();
 			});
 		}
 	});
 
-
 	// Adds the plugin class to the list of available TinyMCE plugins
 	tinymce.PluginManager.add("ssbuttons", tinymce.plugins.SSButtons);
 })();
\ No newline at end of file