From fd5884dbacea9953244837790049e7741f73069b Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Mon, 5 Jan 2009 02:55:57 +0000 Subject: [PATCH] BUGFIX: didn't work on IE git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@69684 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/TinyMCEImageEnhancement.js | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/javascript/TinyMCEImageEnhancement.js b/javascript/TinyMCEImageEnhancement.js index 5284d75b..6b3e7878 100644 --- a/javascript/TinyMCEImageEnhancement.js +++ b/javascript/TinyMCEImageEnhancement.js @@ -18,11 +18,16 @@ TinyMCEImageEnhancement.prototype = { Event.observe($('FolderCancel'),'click',this.onFolderCancel.bind(this)); Event.observe($('UploadFiles'),'click',this.onUpload.bind(this)); - // Image alignment/style changing link - Event.observe($('ImageAligmentStyle_left'),'click',this.onChangeImageAlignmentStyle.bind(this)); - Event.observe($('ImageAligmentStyle_leftAlone'),'click',this.onChangeImageAlignmentStyle.bind(this)); - Event.observe($('ImageAligmentStyle_right'),'click',this.onChangeImageAlignmentStyle.bind(this)); - Event.observe($('ImageAligmentStyle_center'),'click',this.onChangeImageAlignmentStyle.bind(this)); + jQuery("#ImageAligmentStyle a").click(function() { + id = jQuery(this).attr('id'); + jQuery(this).siblings().removeClass('selected'); + jQuery(this).addClass('selected'); + // get alignment from id, e.g. ImageAlignment_center -> center + aligment = id.split('_')[1]; + $('Form_EditorToolbarImageForm_CSSClass').value = aligment; + + return false; + }); }, /** @@ -47,17 +52,6 @@ TinyMCEImageEnhancement.prototype = { } } }, - - onChangeImageAlignmentStyle: function(event) { - Event.stop(event); - id = event.target.id ; - jQuery(event.target).siblings().removeClass('selected'); - jQuery(event.target).addClass('selected'); - - // get alignment from id, e.g. ImageAlignment_center -> center - aligment = id.split('_')[1]; - $('Form_EditorToolbarImageForm_CSSClass').value = aligment; - }, /** * Called when user clicks "add folder" anchor.