ckeditor/plugins/crossreference/dialogs/crossreference-anchor.js
changeset 5 c925ae656709
parent 0 44d330dccc59
     1.1 --- a/ckeditor/plugins/crossreference/dialogs/crossreference-anchor.js	Sat Dec 17 03:31:51 2016 +0300
     1.2 +++ b/ckeditor/plugins/crossreference/dialogs/crossreference-anchor.js	Wed Dec 21 17:20:19 2016 +0300
     1.3 @@ -88,7 +88,7 @@
     1.4  			this.element = selection.getStartElement();
     1.5  			if (this.element)
     1.6  				this.element = this.element.getAscendant('a', true);
     1.7 -			if (!this.element || this.element.getName() != 'a') {
     1.8 +			if (!this.element || this.element.getName() != 'a' || !this.element.hasAttribute('cross-anchor')) {
     1.9  				this.element = editor.document.createElement('a');
    1.10  				var guid = generateUUID();
    1.11  				this.element.setAttribute('cross-guid', guid);
    1.12 @@ -97,7 +97,9 @@
    1.13  				this.insertMode = false;
    1.14  			}
    1.15  			
    1.16 -			if (!this.insertMode)
    1.17 +			if (this.insertMode)
    1.18 +				this.setValueOf('tab-main', 'name', selection.getSelectedText().trim());
    1.19 +			else
    1.20  				this.setupContent(this.element);
    1.21  		},
    1.22