Skip to content

Commit

Permalink
Merge branch 't/11801b'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Apr 29, 2014
2 parents dc7bcdb + a512067 commit 59a8141
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ CKEditor 4 Changelog
## CKEditor 4.4.1

Fixed Issues:

* [#11754](http://dev.ckeditor.com/ticket/11754): Fixed: Infinite loop in Google Chrome when contents contains not closed attributes.
* [#11848](http://dev.ckeditor.com/ticket/11848): Fixed: [`editor.insertElement()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertElement) throwing an exception in IE, when there was no selection in editor.
* [#11801](http://dev.ckeditor.com/ticket/11801): Fixed: Editor anchors unavailable when linking [Enhanced Image](http://ckeditor.com/addon/image2) widget.

Other changes:

Expand Down
37 changes: 15 additions & 22 deletions plugins/link/dialogs/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
return commitParams.call( this, 'advanced', data );
};


var commonLang = editor.lang.common,
linkLang = editor.lang.link;
linkLang = editor.lang.link,
anchors;

return {
title: linkLang.title,
Expand Down Expand Up @@ -258,10 +258,9 @@
id: 'selectAnchorText',
label: linkLang.selectAnchor,
setup: function( data ) {
if ( data.anchors && data.anchors.length > 0 )
this.getElement().show();
else
this.getElement().hide();
anchors = plugin.getEditorAnchors( editor );

this.getElement()[ anchors && anchors.length ? 'show' : 'hide' ]();
},
children: [
{
Expand All @@ -281,10 +280,10 @@
this.clear();
this.add( '' );

if ( data.anchors ) {
for ( var i = 0; i < data.anchors.length; i++ ) {
if ( data.anchors[ i ].name )
this.add( data.anchors[ i ].name );
if ( anchors ) {
for ( var i = 0; i < anchors.length; i++ ) {
if ( anchors[ i ].name )
this.add( anchors[ i ].name );
}
}

Expand Down Expand Up @@ -315,10 +314,10 @@
this.clear();
this.add( '' );

if ( data.anchors ) {
for ( var i = 0; i < data.anchors.length; i++ ) {
if ( data.anchors[ i ].id )
this.add( data.anchors[ i ].id );
if ( anchors ) {
for ( var i = 0; i < anchors.length; i++ ) {
if ( anchors[ i ].id )
this.add( anchors[ i ].id );
}
}

Expand All @@ -334,10 +333,7 @@
}
],
setup: function( data ) {
if ( data.anchors && data.anchors.length > 0 )
this.getElement().show();
else
this.getElement().hide();
this.getElement()[ anchors && anchors.length ? 'show' : 'hide' ]();
}
}
]
Expand All @@ -350,10 +346,7 @@
// Focus the first element defined in above html.
focus: true,
setup: function( data ) {
if ( data.anchors && data.anchors.length < 1 )
this.getElement().show();
else
this.getElement().hide();
this.getElement()[ anchors && anchors.length ? 'hide' : 'show' ]();
}
}
],
Expand Down
6 changes: 0 additions & 6 deletions plugins/link/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,6 @@
retval.advanced = advanced;
}

// Find out whether we have any anchors in the editor.
var anchors = CKEDITOR.plugins.link.getEditorAnchors( editor );

if ( anchors.length )
retval.anchors = anchors;

return retval;
},

Expand Down

0 comments on commit 59a8141

Please sign in to comment.