diff --git a/apps/documenteditor/main/app/view/BookmarksDialog.js b/apps/documenteditor/main/app/view/BookmarksDialog.js
index 8a459c789..f6823788f 100644
--- a/apps/documenteditor/main/app/view/BookmarksDialog.js
+++ b/apps/documenteditor/main/app/view/BookmarksDialog.js
@@ -90,14 +90,14 @@ define([
'
',
'',
'',
- '',
- ' ',
- '',
- ' | ',
'
',
'',
@@ -138,9 +138,11 @@ define([
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
+ if (exist) {
+ var rec = me.bookmarksList.store.findWhere({value: value});
+ me.bookmarksList.selectRecord(rec);
+ me.bookmarksList.scrollToRecord(rec);
+ } else
me.bookmarksList.deselectAll();
me.btnAdd.setDisabled(!check && !exist);
me.btnGoto.setDisabled(!exist);
@@ -182,7 +184,7 @@ define([
el: $('#bookmarks-btn-add'),
disabled: true
});
- this.$window.find('#bookmarks-btn-add').on('click', _.bind(this.onDlgBtnClick, this));
+ this.btnAdd.on('click', _.bind(this.addBookmark, this));
this.btnGoto = new Common.UI.Button({
el: $('#bookmarks-btn-goto'),
@@ -273,11 +275,6 @@ define([
},
onDlgBtnClick: function(event) {
- var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
- if (state == 'add') {
- this.props.asc_AddBookmark(this.txtName.getValue());
- }
-
this.close();
},
@@ -322,6 +319,14 @@ define([
}
},
+ addBookmark: function(btn, eOpts){
+ this.props.asc_AddBookmark(this.txtName.getValue());
+ this.refreshBookmarks();
+ var rec = this.bookmarksList.store.findWhere({value: this.txtName.getValue()});
+ this.bookmarksList.selectRecord(rec);
+ this.bookmarksList.scrollToRecord(rec);
+ },
+
onDblClickBookmark: function(listView, itemView, record) {
this.props.asc_SelectBookmark(record.get('value'));
},
@@ -376,7 +381,7 @@ define([
textClose: 'Close',
textHidden: 'Hidden bookmarks',
txtInvalidName: 'Bookmark name can only contain letters, digits and underscores, and should begin with the letter',
- textGetLink: 'Link to bookmark',
+ textGetLink: 'Get Link',
textCopy: 'Copy'
}, DE.Views.BookmarksDialog || {}))
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index e07514514..121946865 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -1009,7 +1009,7 @@
"DE.Views.BookmarksDialog.textName": "Name",
"DE.Views.BookmarksDialog.textSort": "Sort by",
"DE.Views.BookmarksDialog.textTitle": "Bookmarks",
- "DE.Views.BookmarksDialog.textGetLink": "Link to Bookmark",
+ "DE.Views.BookmarksDialog.textGetLink": "Get Link",
"DE.Views.BookmarksDialog.textCopy": "Copy",
"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",