[DE] Fix Bug 38413
This commit is contained in:
parent
793f7a5acf
commit
052c892064
|
@ -123,11 +123,24 @@ define([
|
||||||
el : $('#bookmarks-txt-name'),
|
el : $('#bookmarks-txt-name'),
|
||||||
allowBlank : true,
|
allowBlank : true,
|
||||||
validateOnChange: true,
|
validateOnChange: true,
|
||||||
validateOnBlur: false,
|
validateOnBlur: true,
|
||||||
style : 'width: 195px;',
|
style : 'width: 195px;',
|
||||||
value : '',
|
value : '',
|
||||||
maxLength: 40
|
maxLength: 40,
|
||||||
}).on('changing', _.bind(this.onNameChanging, this));
|
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({
|
this.radioName = new Common.UI.RadioBox({
|
||||||
el: $('#bookmarks-radio-name'),
|
el: $('#bookmarks-radio-name'),
|
||||||
|
@ -291,17 +304,6 @@ define([
|
||||||
this.refreshBookmarks();
|
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',
|
textTitle: 'Bookmarks',
|
||||||
textLocation: 'Location',
|
textLocation: 'Location',
|
||||||
textBookmarkName: 'Bookmark name',
|
textBookmarkName: 'Bookmark name',
|
||||||
|
@ -311,7 +313,8 @@ define([
|
||||||
textGoto: 'Go to',
|
textGoto: 'Go to',
|
||||||
textDelete: 'Delete',
|
textDelete: 'Delete',
|
||||||
textClose: 'Close',
|
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 || {}))
|
}, DE.Views.BookmarksDialog || {}))
|
||||||
});
|
});
|
|
@ -814,6 +814,7 @@
|
||||||
"DE.Views.BookmarksDialog.textName": "Name",
|
"DE.Views.BookmarksDialog.textName": "Name",
|
||||||
"DE.Views.BookmarksDialog.textSort": "Sort by",
|
"DE.Views.BookmarksDialog.textSort": "Sort by",
|
||||||
"DE.Views.BookmarksDialog.textTitle": "Bookmarks",
|
"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.textAdvanced": "Show advanced settings",
|
||||||
"DE.Views.ChartSettings.textArea": "Area",
|
"DE.Views.ChartSettings.textArea": "Area",
|
||||||
"DE.Views.ChartSettings.textBar": "Bar",
|
"DE.Views.ChartSettings.textBar": "Bar",
|
||||||
|
|
Loading…
Reference in a new issue