Browse files

Fixing Bug #1791 for real this time ;-)

  • Loading branch information...
1 parent d390aca commit 53542fb830f4d5bcf54140b81f54b07857c6cbf3 julmis committed Aug 26, 2004
Showing with 10 additions and 7 deletions.
  1. +10 −7 lib/editor/htmlarea.php
View
17 lib/editor/htmlarea.php
@@ -1321,14 +1321,17 @@ function (str, l1, l2, l3) {
if (typeof link == "undefined") {
link = this.getParentElement();
if (link && !/^a$/i.test(link.tagName)) {
- link = null;
- var sel = this._getSelection();
- var rng = this._createRange(sel);
- var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
- if(len < 1) {
- alert("You must select text first!");
- return false;
+ if(link.tagName.toLowerCase() != 'img') {
+ link = null;
+ var sel = this._getSelection();
+ var rng = this._createRange(sel);
+ var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
+ if(len < 1) {
+ alert("You must select text first!");
+ return false;
+ }
}
+ link = null;
}
}
if (link) {

0 comments on commit 53542fb

Please sign in to comment.