Fix Bug 35539 + Hide context menu on document caption.

This commit is contained in:
Julia Radzhabova 2017-08-08 11:17:18 +03:00
parent d66a4a0c53
commit 1587ae9f2d

View file

@ -70,7 +70,7 @@ define([
'</ul>'); '</ul>');
var templateRightBox = '<section>' + var templateRightBox = '<section>' +
'<section id="box-doc-name"><input type="text" id="rib-doc-name" spellcheck="false"></input></section>' + '<section id="box-doc-name"><input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false"></input></section>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' + '<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' + '<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' + '<div class="btn-slot" id="slot-hbtn-edit"></div>' +
@ -387,7 +387,7 @@ define([
}); });
if ( this.documentCaption ) { if ( this.documentCaption ) {
this.labelDocName.text( Common.Utils.String.htmlEncode(this.documentCaption) ); this.labelDocName.val( this.documentCaption );
} }
if ( !_.isUndefined(this.options.canRename) ) { if ( !_.isUndefined(this.options.canRename) ) {
@ -485,9 +485,8 @@ define([
this.documentCaption = value; this.documentCaption = value;
this.isModified && (value += '*'); this.isModified && (value += '*');
if ( this.labelDocName ) { if ( this.labelDocName ) {
var encoded = Common.Utils.String.htmlEncode(value); this.labelDocName.val( value );
this.labelDocName.val( encoded ); this.labelDocName.attr('size', value.length);
this.labelDocName.attr('size', encoded.length);
this.setCanRename(true); this.setCanRename(true);
} }
@ -502,10 +501,10 @@ define([
setDocumentChanged: function (changed) { setDocumentChanged: function (changed) {
this.isModified = changed; this.isModified = changed;
var _name = Common.Utils.String.htmlEncode(this.documentCaption); var _name = this.documentCaption;
changed && (_name += '*'); changed && (_name += '*');
this.labelDocName.html(_name); this.labelDocName.val(_name);
}, },
setCanBack: function (value) { setCanBack: function (value) {
@ -538,6 +537,7 @@ define([
tip.setContent(); tip.setContent();
} }
} }
label.attr('data-can-copy', rename);
} }
}, },