[DE] Fix Bug 38413
This commit is contained in:
parent
793f7a5acf
commit
052c892064
|
@ -123,11 +123,24 @@ define([
|
|||
el : $('#bookmarks-txt-name'),
|
||||
allowBlank : true,
|
||||
validateOnChange: true,
|
||||
validateOnBlur: false,
|
||||
validateOnBlur: true,
|
||||
style : 'width: 195px;',
|
||||
value : '',
|
||||
maxLength: 40
|
||||
}).on('changing', _.bind(this.onNameChanging, this));
|
||||
maxLength: 40,
|
||||
validation : function(value) {
|
||||
var exist = me.props.asc_HaveBookmark(value),
|
||||
check = me.props.asc_CheckNewBookmarkName(value);
|
||||
if (exist)
|
||||
me.bookmarksList.selectRecord(me.bookmarksList.store.findWhere({value: value}));
|
||||
else
|
||||
me.bookmarksList.deselectAll();
|
||||
me.btnAdd.setDisabled(!check && !exist);
|
||||
me.btnGoto.setDisabled(!exist);
|
||||
me.btnDelete.setDisabled(!exist);
|
||||
|
||||
return (check || _.isEmpty(value)) ? true : me.txtInvalidName;
|
||||
}
|
||||
});
|
||||
|
||||
this.radioName = new Common.UI.RadioBox({
|
||||
el: $('#bookmarks-radio-name'),
|
||||
|
@ -291,17 +304,6 @@ define([
|
|||
this.refreshBookmarks();
|
||||
},
|
||||
|
||||
onNameChanging: function (input, value) {
|
||||
var exist = this.props.asc_HaveBookmark(value);
|
||||
if (exist)
|
||||
this.bookmarksList.selectRecord(this.bookmarksList.store.findWhere({value: value}));
|
||||
else
|
||||
this.bookmarksList.deselectAll();
|
||||
this.btnAdd.setDisabled(!this.props.asc_CheckNewBookmarkName(value) && !exist);
|
||||
this.btnGoto.setDisabled(!exist);
|
||||
this.btnDelete.setDisabled(!exist);
|
||||
},
|
||||
|
||||
textTitle: 'Bookmarks',
|
||||
textLocation: 'Location',
|
||||
textBookmarkName: 'Bookmark name',
|
||||
|
@ -311,7 +313,8 @@ define([
|
|||
textGoto: 'Go to',
|
||||
textDelete: 'Delete',
|
||||
textClose: 'Close',
|
||||
textHidden: 'Hidden bookmarks'
|
||||
textHidden: 'Hidden bookmarks',
|
||||
txtInvalidName: 'Bookmark name can only contain letters, digits and underscores, and should begin with the letter'
|
||||
|
||||
}, DE.Views.BookmarksDialog || {}))
|
||||
});
|
|
@ -814,6 +814,7 @@
|
|||
"DE.Views.BookmarksDialog.textName": "Name",
|
||||
"DE.Views.BookmarksDialog.textSort": "Sort by",
|
||||
"DE.Views.BookmarksDialog.textTitle": "Bookmarks",
|
||||
"DE.Views.BookmarksDialog.txtInvalidName": "Bookmark name can only contain letters, digits and underscores, and should begin with the letter",
|
||||
"DE.Views.ChartSettings.textAdvanced": "Show advanced settings",
|
||||
"DE.Views.ChartSettings.textArea": "Area",
|
||||
"DE.Views.ChartSettings.textBar": "Bar",
|
||||
|
|
Loading…
Reference in a new issue