[Common] setCanRename caused a error before doc name label wasn't created
This commit is contained in:
parent
773a2e210f
commit
cb5e41fa78
|
@ -386,6 +386,14 @@ define([
|
||||||
'keydown': onDocNameKeyDown.bind(this)
|
'keydown': onDocNameKeyDown.bind(this)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ( this.documentCaption ) {
|
||||||
|
this.labelDocName.text( Common.Utils.String.htmlEncode(this.documentCaption) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !_.isUndefined(this.options.canRename) ) {
|
||||||
|
this.setCanRename(this.options.canRename);
|
||||||
|
}
|
||||||
|
|
||||||
$saveStatus = $html.find('#rib-save-status');
|
$saveStatus = $html.find('#rib-save-status');
|
||||||
$saveStatus.hide();
|
$saveStatus.hide();
|
||||||
|
|
||||||
|
@ -431,11 +439,6 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.documentCaption ) {
|
|
||||||
$html.find('#rib-doc-name').text(
|
|
||||||
Common.Utils.String.htmlEncode(this.documentCaption) );
|
|
||||||
}
|
|
||||||
|
|
||||||
$userList = $html.find('.cousers-list');
|
$userList = $html.find('.cousers-list');
|
||||||
$panelUsers = $html.find('.box-cousers');
|
$panelUsers = $html.find('.box-cousers');
|
||||||
$btnUsers = $html.find('.btn-users');
|
$btnUsers = $html.find('.btn-users');
|
||||||
|
@ -518,19 +521,22 @@ define([
|
||||||
setCanRename: function (rename) {
|
setCanRename: function (rename) {
|
||||||
rename = false;
|
rename = false;
|
||||||
|
|
||||||
var me = this,
|
var me = this;
|
||||||
label = me.labelDocName;
|
me.options.canRename = rename;
|
||||||
if ( rename ) {
|
if ( me.labelDocName ) {
|
||||||
label.removeAttr('disabled').tooltip({
|
var label = me.labelDocName;
|
||||||
title: me.txtRename,
|
if ( rename ) {
|
||||||
placement: 'cursor'}
|
label.removeAttr('disabled').tooltip({
|
||||||
);
|
title: me.txtRename,
|
||||||
} else {
|
placement: 'cursor'}
|
||||||
label.attr('disabled', true);
|
);
|
||||||
var tip = label.data('bs.tooltip');
|
} else {
|
||||||
if ( tip ) {
|
label.attr('disabled', true);
|
||||||
tip.options.title = '';
|
var tip = label.data('bs.tooltip');
|
||||||
tip.setContent();
|
if ( tip ) {
|
||||||
|
tip.options.title = '';
|
||||||
|
tip.setContent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue