[Common] rename document in title
This commit is contained in:
parent
f802cc735a
commit
0bb1d90bb3
|
@ -70,7 +70,9 @@ define([
|
||||||
'</ul>');
|
'</ul>');
|
||||||
|
|
||||||
var templateRightBox = '<section>' +
|
var templateRightBox = '<section>' +
|
||||||
'<section id="box-doc-name"><input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="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>' +
|
||||||
|
@ -382,12 +384,13 @@ define([
|
||||||
|
|
||||||
if ( this.labelDocName ) this.labelDocName.off();
|
if ( this.labelDocName ) this.labelDocName.off();
|
||||||
this.labelDocName = $html.find('#rib-doc-name');
|
this.labelDocName = $html.find('#rib-doc-name');
|
||||||
this.labelDocName.on({
|
// this.labelDocName.attr('maxlength', 50);
|
||||||
'keydown': onDocNameKeyDown.bind(this)
|
this.labelDocName.text = function (text) {
|
||||||
});
|
this.val(text).attr('size', text.length);
|
||||||
|
}
|
||||||
|
|
||||||
if ( this.documentCaption ) {
|
if ( this.documentCaption ) {
|
||||||
this.labelDocName.val( this.documentCaption );
|
this.labelDocName.text( this.documentCaption );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !_.isUndefined(this.options.canRename) ) {
|
if ( !_.isUndefined(this.options.canRename) ) {
|
||||||
|
@ -485,8 +488,8 @@ define([
|
||||||
this.documentCaption = value;
|
this.documentCaption = value;
|
||||||
this.isModified && (value += '*');
|
this.isModified && (value += '*');
|
||||||
if ( this.labelDocName ) {
|
if ( this.labelDocName ) {
|
||||||
this.labelDocName.val( value );
|
this.labelDocName.text( value );
|
||||||
this.labelDocName.attr('size', value.length);
|
// this.labelDocName.attr('size', value.length);
|
||||||
|
|
||||||
this.setCanRename(true);
|
this.setCanRename(true);
|
||||||
}
|
}
|
||||||
|
@ -504,7 +507,7 @@ define([
|
||||||
var _name = this.documentCaption;
|
var _name = this.documentCaption;
|
||||||
changed && (_name += '*');
|
changed && (_name += '*');
|
||||||
|
|
||||||
this.labelDocName.val(_name);
|
this.labelDocName.text(_name);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCanBack: function (value) {
|
setCanBack: function (value) {
|
||||||
|
@ -529,7 +532,16 @@ define([
|
||||||
title: me.txtRename,
|
title: me.txtRename,
|
||||||
placement: 'cursor'}
|
placement: 'cursor'}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
label.on({
|
||||||
|
'keydown': onDocNameKeyDown.bind(this),
|
||||||
|
'blur': function (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
label.off();
|
||||||
label.attr('disabled', true);
|
label.attr('disabled', true);
|
||||||
var tip = label.data('bs.tooltip');
|
var tip = label.data('bs.tooltip');
|
||||||
if ( tip ) {
|
if ( tip ) {
|
||||||
|
|
|
@ -100,8 +100,16 @@
|
||||||
border: 0 none;
|
border: 0 none;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
||||||
&:focus {
|
&:hover:not(:disabled) {
|
||||||
|
border: 1px solid @gray-dark;
|
||||||
|
background-color: rgba(255,255,255,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus:not(:active) {
|
||||||
|
border: 1px solid @gray-dark;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
|
background-color: white;
|
||||||
|
color: @gray-deep;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue