Skip to content

Commit

Permalink
Fixed bug where setting border in advimage plugin would throw error i…
Browse files Browse the repository at this point in the history
…n IE.
  • Loading branch information
alecpl committed Mar 25, 2011
1 parent d89220e commit ff38117
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Version 3.4.1.x (2011-03-xx)
Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
Fixed bug where image border color/style values were overwritten by advimage plugin.
Fixed bug where setting border in advimage plugin would throw error in IE.
Fixed bug where the context menu wouldn't select images on WebKit browsers.
Version 3.4.1 (2011-03-24)
Added significantly improved list handling via the new 'lists' plugin.
Expand Down
14 changes: 10 additions & 4 deletions jscripts/tiny_mce/plugins/advimage/js/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ var ImageDialog = {
},

updateStyle : function(ty) {
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});

if (tinyMCEPopup.editor.settings.inline_styles) {
// Handle align
Expand Down Expand Up @@ -389,10 +389,16 @@ var ImageDialog = {
v = f.border.value;
if (v || v == '0') {
if (v == '0')
img.style.border = '0 none none';
img.style.border = isIE ? '0' : '0 none none';
else {
bStyle = b[1] ? b[1] : bStyle ? bStyle : 'solid';
bColor = b[2] ? b[2] : bColor ? bColor : 'black';
if (b.length == 3 && b[isIE ? 2 : 1])
bStyle = b[isIE ? 2 : 1];
else if (!bStyle || bStyle == 'none')
bStyle = 'solid';
if (b.length == 3 && b[isIE ? 0 : 2])
bColor = b[isIE ? 0 : 2];
else if (!bColor || bColor == 'none')
bColor = 'black';
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
}
}
Expand Down

0 comments on commit ff38117

Please sign in to comment.