From b7b0e1ab0ba4a2063ff09a996b7fa0cc9018b64f Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 4 Oct 2010 05:21:04 +0000 Subject: [PATCH] BUGFIX: Closing TinyMCE image, link or flash panel when loading form (ticket #4907) (from r98690) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111599 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/ModelAdmin.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/javascript/ModelAdmin.js b/javascript/ModelAdmin.js index 0afa23b5..36f3374c 100644 --- a/javascript/ModelAdmin.js +++ b/javascript/ModelAdmin.js @@ -18,7 +18,7 @@ ////////////////////////////////////////////////////////////////// // Search form ////////////////////////////////////////////////////////////////// - + /** * Class: #ModelClassSelector select * @@ -63,6 +63,8 @@ onsubmit: function(e) { // Import forms are processed without ajax if(this.is('#Form_ImportForm')) return true; + + $('#contentPanel').closeRightPanel(); this.trigger('beforeSubmit'); @@ -119,7 +121,8 @@ return false; } }); - + + /** * Class: .resultsTable tbody td * @@ -193,6 +196,21 @@ this._super(); } }); + + $('#contentPanel').entwine({ + /** + * Close TinyMCE image, link or flash panel. + * this function is called everytime a new search, back or add new DataObject are clicked + **/ + closeRightPanel: function(){ + if($('#contentPanel').is(':visible')) { + $('#contentPanel').hide(); + $('#Form_EditorToolbarImageForm').hide(); + $('#Form_EditorToolbarFlashForm').hide(); + $('#Form_EditorToolbarLinkForm').hide(); + } + } + }); }); })(jQuery); \ No newline at end of file