[DE] Bug 41231

This commit is contained in:
Julia Radzhabova 2019-09-18 11:58:40 +03:00
parent 582a9928a1
commit 498013d6d3

View file

@ -136,9 +136,10 @@ define([
value : '', value : '',
maxLength: 40, maxLength: 40,
validation : function(value) { validation : function(value) {
var check = me.props.asc_CheckNewBookmarkName(value); var check = me.props.asc_CheckNewBookmarkName(value),
me.btnAdd.setDisabled(!check); exist = me.props.asc_HaveBookmark(value);
return (check || _.isEmpty(value)) ? true : me.txtInvalidName; me.btnAdd.setDisabled(!check && !exist);
return (check || _.isEmpty(value) || exist) ? true : me.txtInvalidName;
} }
}).on ('changing', function (input, value) { }).on ('changing', function (input, value) {
var exist = me.props.asc_HaveBookmark(value); var exist = me.props.asc_HaveBookmark(value);
@ -314,7 +315,10 @@ define([
gotoBookmark: function(btn, eOpts){ gotoBookmark: function(btn, eOpts){
var rec = this.bookmarksList.getSelectedRec(); var rec = this.bookmarksList.getSelectedRec();
rec && this.props.asc_SelectBookmark(rec.get('value')); if (rec)
this.props.asc_SelectBookmark(rec.get('value'));
else if (this.txtName.getValue()!=='')
this.props.asc_SelectBookmark(this.txtName.getValue());
}, },
addBookmark: function(btn, eOpts){ addBookmark: function(btn, eOpts){