diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 6622a1fa8..30745fa1c 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -356,6 +356,10 @@ define([ if ( me.btnOptions ) me.btnOptions.updateHint(me.tipViewSettings); + + if (me.btnSearch) + me.btnSearch.updateHint(me.tipSearch + Common.Utils.String.platformKey('Ctrl+F')); + } function onFocusDocName(e){ @@ -870,7 +874,8 @@ define([ tipViewSettings: 'View Settings', textRemoveFavorite: 'Remove from Favorites', textAddFavorite: 'Mark as favorite', - textHideNotes: 'Hide Notes' + textHideNotes: 'Hide Notes', + tipSearch: 'Search' } }(), Common.Views.Header || {})) }); diff --git a/apps/common/main/lib/view/SearchPanel.js b/apps/common/main/lib/view/SearchPanel.js index 6e718be65..9fd890c29 100644 --- a/apps/common/main/lib/view/SearchPanel.js +++ b/apps/common/main/lib/view/SearchPanel.js @@ -86,13 +86,11 @@ define([ style: 'width: 100%;' }); - this.$reaultsNumber = $('#search-adv-results-number'); - this.updateResultsNumber('no-results'); - this.btnBack = new Common.UI.Button({ parentEl: $('#search-adv-back'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-arrow-up', + hint: this.tipPreviousResult, dataHint: '1', dataHintDirection: 'bottom' }); @@ -102,6 +100,7 @@ define([ parentEl: $('#search-adv-next'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-arrow-down', + hint: this.tipNextResult, dataHint: '1', dataHintDirection: 'bottom' }); @@ -117,6 +116,9 @@ define([ }); this.btnReplaceAll.on('click', _.bind(this.onReplaceClick, this, 'replaceall')); + this.$reaultsNumber = $('#search-adv-results-number'); + this.updateResultsNumber('no-results'); + this.chCaseSensitive = new Common.UI.CheckBox({ el: $('#search-adv-case-sensitive'), labelText: this.textCaseSensitive, @@ -310,6 +312,7 @@ define([ text = current === 'no-results' ? this.textNoSearchResults : (!count ? this.textNoMatches : Common.Utils.String.format(this.textSearchResults, current + 1, count)); } this.$reaultsNumber.text(text); + this.disableReplaceButtons(!count); }, onClickClosePanel: function() { @@ -387,6 +390,8 @@ define([ textNoSearchResults: 'No search results', textItemEntireCell: 'Entire cell contents', textTooManyResults: 'There are too many results to show here', + tipPreviousResult: 'Previous result', + tipNextResult: 'Next result', textName: 'Name', textCell: 'Cell', textValue: 'Value', diff --git a/apps/common/main/resources/less/searchdialog.less b/apps/common/main/resources/less/searchdialog.less index d4de49286..8e0ec2cab 100644 --- a/apps/common/main/resources/less/searchdialog.less +++ b/apps/common/main/resources/less/searchdialog.less @@ -221,6 +221,7 @@ .item { padding: 6px 15px; word-break: break-all; + cursor: pointer; &:hover { background-color: @highlight-button-hover-ie; diff --git a/apps/documenteditor/main/app/controller/Search.js b/apps/documenteditor/main/app/controller/Search.js index 0bf486d19..37ec57ebf 100644 --- a/apps/documenteditor/main/app/controller/Search.js +++ b/apps/documenteditor/main/app/controller/Search.js @@ -121,6 +121,12 @@ define([ this._state.useRegExp = checked; break; } + if (this._state.searchText !== '' && this.onQuerySearch()) { + this.hideResults(); + clearInterval(this.searchTimer); + this.searchTimer = undefined; + this.api.asc_StartTextAroundSearch(); + } }, onSearchNext: function (type, text, e) { diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 7d9bf9644..49e9ea585 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -108,7 +108,7 @@ define([ this.btnSearchBar = new Common.UI.Button({ action: 'advancedsearch', el: $markup.elementById('#left-btn-searchbar'), - hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'), + hint: this.tipSearch, disabled: true, enableToggle: true, toggleGroup: 'leftMenuGroup' diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 6bce19a56..c1f62eef2 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -296,6 +296,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.tipSearch": "Search", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", diff --git a/apps/presentationeditor/main/app/controller/Search.js b/apps/presentationeditor/main/app/controller/Search.js index 4b02f1fce..82efb20ef 100644 --- a/apps/presentationeditor/main/app/controller/Search.js +++ b/apps/presentationeditor/main/app/controller/Search.js @@ -118,6 +118,12 @@ define([ this._state.useRegExp = checked; break; } + if (this._state.searchText !== '' && this.onQuerySearch()) { + this.hideResults(); + clearInterval(this.searchTimer); + this.searchTimer = undefined; + this.api.asc_StartTextAroundSearch(); + } }, onSearchNext: function (type, text, e) { diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js index cd1861b3b..84674b0d4 100644 --- a/apps/presentationeditor/main/app/view/LeftMenu.js +++ b/apps/presentationeditor/main/app/view/LeftMenu.js @@ -104,7 +104,7 @@ define([ this.btnSearchBar = new Common.UI.Button({ action: 'advancedsearch', el: $markup.elementById('#left-btn-searchbar'), - hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'), + hint: this.tipSearch, disabled: true, enableToggle: true, toggleGroup: 'leftMenuGroup' diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index cb91ef684..b89850e4c 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -381,6 +381,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.tipSearch": "Search", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 77616b502..ce50023c7 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -94,7 +94,7 @@ define([ this.btnSearchBar = new Common.UI.Button({ action: 'advancedsearch', el: $markup.elementById('#left-btn-searchbar'), - hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'), + hint: this.tipSearch, disabled: true, enableToggle: true, toggleGroup: 'leftMenuGroup' diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 7c9036c81..978481d00 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -237,6 +237,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.tipSearch": "Search", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes",