commit
2e04d92d0b
|
@ -210,6 +210,7 @@ define([
|
||||||
}).on('keyup:after', function(input, e) {
|
}).on('keyup:after', function(input, e) {
|
||||||
me.fireEvent('search:options', ['range', input.getValue(), e.keyCode !== Common.UI.Keys.RETURN]);
|
me.fireEvent('search:options', ['range', input.getValue(), e.keyCode !== Common.UI.Keys.RETURN]);
|
||||||
});
|
});
|
||||||
|
this.inputSelectRange.$el.hide();
|
||||||
|
|
||||||
this.cmbSearch = new Common.UI.ComboBox({
|
this.cmbSearch = new Common.UI.ComboBox({
|
||||||
el: $('#search-adv-cmb-search'),
|
el: $('#search-adv-cmb-search'),
|
||||||
|
@ -437,8 +438,8 @@ define([
|
||||||
textValue: 'Value',
|
textValue: 'Value',
|
||||||
textFormula: 'Formula',
|
textFormula: 'Formula',
|
||||||
textSearchHasStopped: 'Search has stopped',
|
textSearchHasStopped: 'Search has stopped',
|
||||||
textContentChanged: 'Document content has changed.',
|
textContentChanged: 'Document changed.',
|
||||||
textSearchAgain: '{0}Search again{1} to make sure the results are current.'
|
textSearchAgain: '{0}Perform new search{1} for accurate results.'
|
||||||
|
|
||||||
}, Common.Views.SearchPanel || {}));
|
}, Common.Views.SearchPanel || {}));
|
||||||
});
|
});
|
|
@ -719,7 +719,7 @@ define([
|
||||||
if (this.isSearchPanelVisible()) {
|
if (this.isSearchPanelVisible()) {
|
||||||
selectedText && this.leftMenu.panelSearch.setFindText(selectedText);
|
selectedText && this.leftMenu.panelSearch.setFindText(selectedText);
|
||||||
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
||||||
this.leftMenu.fireEvent('search:aftershow', this.leftMenu, selectedText);
|
this.leftMenu.fireEvent('search:aftershow', this.leftMenu, selectedText ? selectedText : undefined);
|
||||||
return false;
|
return false;
|
||||||
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
||||||
var viewport = this.getApplication().getController('Viewport');
|
var viewport = this.getApplication().getController('Viewport');
|
||||||
|
@ -735,10 +735,10 @@ define([
|
||||||
Common.NotificationCenter.trigger('search:show');
|
Common.NotificationCenter.trigger('search:show');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.onShowHideSearch(true, selectedText);
|
this.onShowHideSearch(true, selectedText ? selectedText : undefined);
|
||||||
}
|
}
|
||||||
this.leftMenu.btnSearchBar.toggle(true,true);
|
this.leftMenu.btnSearchBar.toggle(true,true);
|
||||||
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
this.leftMenu.panelSearch.focus(selectedText ? s : 'search');
|
||||||
// this.leftMenu.menuFile.hide();
|
// this.leftMenu.menuFile.hide();
|
||||||
return false;
|
return false;
|
||||||
case 'save':
|
case 'save':
|
||||||
|
|
|
@ -90,7 +90,8 @@ define([
|
||||||
matchCase: false,
|
matchCase: false,
|
||||||
matchWord: false,
|
matchWord: false,
|
||||||
useRegExp: false,
|
useRegExp: false,
|
||||||
isHighlightedResults: false
|
isHighlightedResults: false,
|
||||||
|
isContentChanged: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -130,14 +131,7 @@ define([
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (this._state.searchText) {
|
if (this._state.searchText) {
|
||||||
this.hideResults();
|
this.onQuerySearch();
|
||||||
if (this.onQuerySearch()) {
|
|
||||||
if (this.searchTimer) {
|
|
||||||
clearInterval(this.searchTimer);
|
|
||||||
this.searchTimer = undefined;
|
|
||||||
}
|
|
||||||
this.api.asc_StartTextAroundSearch();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -145,16 +139,7 @@ define([
|
||||||
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
||||||
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
||||||
this._state.searchText = text;
|
this._state.searchText = text;
|
||||||
if (this.onQuerySearch(type) && (this.searchTimer || isReturnKey)) {
|
this.onQuerySearch(type, !(this.searchTimer || isReturnKey));
|
||||||
this.hideResults();
|
|
||||||
if (this.searchTimer) {
|
|
||||||
clearInterval(this.searchTimer);
|
|
||||||
this.searchTimer = undefined;
|
|
||||||
}
|
|
||||||
if (this.view.$el.is(':visible')) {
|
|
||||||
this.api.asc_StartTextAroundSearch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -167,26 +152,26 @@ define([
|
||||||
this.searchTimer = setInterval(function(){
|
this.searchTimer = setInterval(function(){
|
||||||
if ((new Date()) - me._lastInputChange < 400) return;
|
if ((new Date()) - me._lastInputChange < 400) return;
|
||||||
|
|
||||||
me.hideResults();
|
|
||||||
me._state.searchText = me._state.newSearchText;
|
me._state.searchText = me._state.newSearchText;
|
||||||
if (me._state.newSearchText !== '' && me.onQuerySearch()) {
|
if (!(me._state.newSearchText !== '' && me.onQuerySearch()) && me._state.newSearchText === '') {
|
||||||
if (me.view.$el.is(':visible')) {
|
|
||||||
me.api.asc_StartTextAroundSearch();
|
|
||||||
}
|
|
||||||
me.view.disableReplaceButtons(false);
|
|
||||||
} else if (me._state.newSearchText === '') {
|
|
||||||
me.view.updateResultsNumber('no-results');
|
me.view.updateResultsNumber('no-results');
|
||||||
me.view.disableNavButtons();
|
me.view.disableNavButtons();
|
||||||
me.view.disableReplaceButtons(true);
|
me.view.disableReplaceButtons(true);
|
||||||
}
|
|
||||||
clearInterval(me.searchTimer);
|
clearInterval(me.searchTimer);
|
||||||
me.searchTimer = undefined;
|
me.searchTimer = undefined;
|
||||||
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onQuerySearch: function (d, w) {
|
onQuerySearch: function (d, noUpdate) {
|
||||||
|
var update = !noUpdate || this._state.isContentChanged;
|
||||||
|
this._state.isContentChanged = false;
|
||||||
|
this.searchTimer && clearInterval(this.searchTimer);
|
||||||
|
this.searchTimer = undefined;
|
||||||
|
update && this.hideResults();
|
||||||
|
|
||||||
var searchSettings = new AscCommon.CSearchSettings();
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
searchSettings.put_Text(this._state.searchText);
|
searchSettings.put_Text(this._state.searchText);
|
||||||
searchSettings.put_MatchCase(this._state.matchCase);
|
searchSettings.put_MatchCase(this._state.matchCase);
|
||||||
|
@ -200,6 +185,10 @@ define([
|
||||||
this.view.disableNavButtons();
|
this.view.disableNavButtons();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (update && this.view.$el.is(':visible')) {
|
||||||
|
this.api.asc_StartTextAroundSearch();
|
||||||
|
}
|
||||||
|
this.view.disableReplaceButtons(false);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -324,7 +313,8 @@ define([
|
||||||
onApiGetTextAroundSearch: function (data) {
|
onApiGetTextAroundSearch: function (data) {
|
||||||
if (this.view && this._state.isStartedAddingResults) {
|
if (this.view && this._state.isStartedAddingResults) {
|
||||||
if (data.length > 300 || !data.length) return;
|
if (data.length > 300 || !data.length) return;
|
||||||
var me = this;
|
var me = this,
|
||||||
|
selectedInd;
|
||||||
me.resultItems = [];
|
me.resultItems = [];
|
||||||
data.forEach(function (item, ind) {
|
data.forEach(function (item, ind) {
|
||||||
var el = document.createElement("div"),
|
var el = document.createElement("div"),
|
||||||
|
@ -334,17 +324,23 @@ define([
|
||||||
me.view.$resultsContainer.append(el);
|
me.view.$resultsContainer.append(el);
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
$(el).addClass('selected');
|
$(el).addClass('selected');
|
||||||
|
selectedInd = ind;
|
||||||
}
|
}
|
||||||
|
|
||||||
var resultItem = {id: item[0], $el: $(el), el: el, selected: isSelected};
|
var resultItem = {id: item[0], $el: $(el), el: el, selected: isSelected};
|
||||||
me.resultItems.push(resultItem);
|
me.resultItems.push(resultItem);
|
||||||
$(el).on('click', _.bind(function (el) {
|
$(el).on('click', _.bind(function (el) {
|
||||||
|
if (me._state.isContentChanged) {
|
||||||
|
me.onQuerySearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var id = item[0];
|
var id = item[0];
|
||||||
me.api.asc_SelectSearchElement(id);
|
me.api.asc_SelectSearchElement(id);
|
||||||
}, me));
|
}, me));
|
||||||
});
|
});
|
||||||
|
|
||||||
this.view.$resultsContainer.show();
|
this.view.$resultsContainer.show();
|
||||||
|
this.scrollToSelectedResult(selectedInd);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -433,7 +429,11 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiSearchEnd: function () {
|
onApiSearchEnd: function () {
|
||||||
this.removeResultItems('stop');
|
if (!this._state.isContentChanged) {
|
||||||
|
this._state.isContentChanged = true;
|
||||||
|
this.view.updateResultsNumber('content-changed');
|
||||||
|
this.view.disableReplaceButtons(true);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiTextReplaced: function(found, replaced) {
|
onApiTextReplaced: function(found, replaced) {
|
||||||
|
|
|
@ -485,6 +485,8 @@
|
||||||
"Common.Views.SearchPanel.textWholeWords": "Whole words only",
|
"Common.Views.SearchPanel.textWholeWords": "Whole words only",
|
||||||
"Common.Views.SearchPanel.tipNextResult": "Next result",
|
"Common.Views.SearchPanel.tipNextResult": "Next result",
|
||||||
"Common.Views.SearchPanel.tipPreviousResult": "Previous result",
|
"Common.Views.SearchPanel.tipPreviousResult": "Previous result",
|
||||||
|
"Common.Views.SearchPanel.textContentChanged": "Document changed.",
|
||||||
|
"Common.Views.SearchPanel.textSearchAgain": "{0}Perform new search{1} for accurate results.",
|
||||||
"Common.Views.SelectFileDlg.textLoading": "Loading",
|
"Common.Views.SelectFileDlg.textLoading": "Loading",
|
||||||
"Common.Views.SelectFileDlg.textTitle": "Select Data Source",
|
"Common.Views.SelectFileDlg.textTitle": "Select Data Source",
|
||||||
"Common.Views.SignDialog.textBold": "Bold",
|
"Common.Views.SignDialog.textBold": "Bold",
|
||||||
|
|
|
@ -562,7 +562,7 @@ define([
|
||||||
if (this.isSearchPanelVisible()) {
|
if (this.isSearchPanelVisible()) {
|
||||||
selectedText && this.leftMenu.panelSearch.setFindText(selectedText);
|
selectedText && this.leftMenu.panelSearch.setFindText(selectedText);
|
||||||
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
||||||
this.leftMenu.fireEvent('search:aftershow', this.leftMenu, selectedText);
|
this.leftMenu.fireEvent('search:aftershow', this.leftMenu, selectedText ? selectedText : undefined);
|
||||||
return false;
|
return false;
|
||||||
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
||||||
var viewport = this.getApplication().getController('Viewport');
|
var viewport = this.getApplication().getController('Viewport');
|
||||||
|
@ -578,10 +578,10 @@ define([
|
||||||
Common.NotificationCenter.trigger('search:show');
|
Common.NotificationCenter.trigger('search:show');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.onShowHideSearch(true, selectedText);
|
this.onShowHideSearch(true, selectedText ? selectedText : undefined);
|
||||||
}
|
}
|
||||||
this.leftMenu.btnSearchBar.toggle(true,true);
|
this.leftMenu.btnSearchBar.toggle(true,true);
|
||||||
this.leftMenu.panelSearch.focus(s);
|
this.leftMenu.panelSearch.focus(selectedText ? s : 'search');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'save':
|
case 'save':
|
||||||
|
|
|
@ -87,7 +87,8 @@ define([
|
||||||
searchText: '',
|
searchText: '',
|
||||||
matchCase: false,
|
matchCase: false,
|
||||||
matchWord: false,
|
matchWord: false,
|
||||||
useRegExp: false
|
useRegExp: false,
|
||||||
|
isContentChanged: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -127,14 +128,7 @@ define([
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (this._state.searchText) {
|
if (this._state.searchText) {
|
||||||
this.hideResults();
|
this.onQuerySearch();
|
||||||
if (this.onQuerySearch()) {
|
|
||||||
if (this.searchTimer) {
|
|
||||||
clearInterval(this.searchTimer);
|
|
||||||
this.searchTimer = undefined;
|
|
||||||
}
|
|
||||||
this.api.asc_StartTextAroundSearch();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -142,16 +136,7 @@ define([
|
||||||
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
||||||
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
||||||
this._state.searchText = text;
|
this._state.searchText = text;
|
||||||
if (this.onQuerySearch(type) && (this.searchTimer || isReturnKey)) {
|
this.onQuerySearch(type, !(this.searchTimer || isReturnKey));
|
||||||
this.hideResults();
|
|
||||||
if (this.searchTimer) {
|
|
||||||
clearInterval(this.searchTimer);
|
|
||||||
this.searchTimer = undefined;
|
|
||||||
}
|
|
||||||
if (this.view.$el.is(':visible')) {
|
|
||||||
this.api.asc_StartTextAroundSearch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -164,26 +149,26 @@ define([
|
||||||
this.searchTimer = setInterval(function(){
|
this.searchTimer = setInterval(function(){
|
||||||
if ((new Date()) - me._lastInputChange < 400) return;
|
if ((new Date()) - me._lastInputChange < 400) return;
|
||||||
|
|
||||||
me.hideResults();
|
|
||||||
me._state.searchText = me._state.newSearchText;
|
me._state.searchText = me._state.newSearchText;
|
||||||
if (me._state.newSearchText !== '' && me.onQuerySearch()) {
|
if (!(me._state.newSearchText !== '' && me.onQuerySearch()) && me._state.newSearchText === '') {
|
||||||
if (me.view.$el.is(':visible')) {
|
|
||||||
me.api.asc_StartTextAroundSearch();
|
|
||||||
}
|
|
||||||
me.view.disableReplaceButtons(false);
|
|
||||||
} else if (me._state.newSearchText === '') {
|
|
||||||
me.view.updateResultsNumber('no-results');
|
me.view.updateResultsNumber('no-results');
|
||||||
me.view.disableNavButtons();
|
me.view.disableNavButtons();
|
||||||
me.view.disableReplaceButtons(true);
|
me.view.disableReplaceButtons(true);
|
||||||
}
|
|
||||||
clearInterval(me.searchTimer);
|
clearInterval(me.searchTimer);
|
||||||
me.searchTimer = undefined;
|
me.searchTimer = undefined;
|
||||||
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onQuerySearch: function (d, w) {
|
onQuerySearch: function (d, noUpdate) {
|
||||||
|
var update = !noUpdate || this._state.isContentChanged;
|
||||||
|
this._state.isContentChanged = false;
|
||||||
|
this.searchTimer && clearInterval(this.searchTimer);
|
||||||
|
this.searchTimer = undefined;
|
||||||
|
update && this.hideResults();
|
||||||
|
|
||||||
var searchSettings = new AscCommon.CSearchSettings();
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
searchSettings.put_Text(this._state.searchText);
|
searchSettings.put_Text(this._state.searchText);
|
||||||
searchSettings.put_MatchCase(this._state.matchCase);
|
searchSettings.put_MatchCase(this._state.matchCase);
|
||||||
|
@ -197,6 +182,11 @@ define([
|
||||||
this.view.disableNavButtons();
|
this.view.disableNavButtons();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (update && this.view.$el.is(':visible')) {
|
||||||
|
this.api.asc_StartTextAroundSearch();
|
||||||
|
}
|
||||||
|
this.view.disableReplaceButtons(false);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -289,7 +279,8 @@ define([
|
||||||
onApiGetTextAroundSearch: function (data) {
|
onApiGetTextAroundSearch: function (data) {
|
||||||
if (this.view && this._state.isStartedAddingResults) {
|
if (this.view && this._state.isStartedAddingResults) {
|
||||||
if (data.length > 300 || !data.length) return;
|
if (data.length > 300 || !data.length) return;
|
||||||
var me = this;
|
var me = this,
|
||||||
|
selectedInd;
|
||||||
me.resultItems = [];
|
me.resultItems = [];
|
||||||
data.forEach(function (item, ind) {
|
data.forEach(function (item, ind) {
|
||||||
var el = document.createElement("div"),
|
var el = document.createElement("div"),
|
||||||
|
@ -299,17 +290,23 @@ define([
|
||||||
me.view.$resultsContainer.append(el);
|
me.view.$resultsContainer.append(el);
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
$(el).addClass('selected');
|
$(el).addClass('selected');
|
||||||
|
selectedInd = ind;
|
||||||
}
|
}
|
||||||
|
|
||||||
var resultItem = {id: item[0], $el: $(el), el: el, selected: isSelected};
|
var resultItem = {id: item[0], $el: $(el), el: el, selected: isSelected};
|
||||||
me.resultItems.push(resultItem);
|
me.resultItems.push(resultItem);
|
||||||
$(el).on('click', _.bind(function (el) {
|
$(el).on('click', _.bind(function (el) {
|
||||||
|
if (me._state.isContentChanged) {
|
||||||
|
me.onQuerySearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var id = item[0];
|
var id = item[0];
|
||||||
me.api.asc_SelectSearchElement(id);
|
me.api.asc_SelectSearchElement(id);
|
||||||
}, me));
|
}, me));
|
||||||
});
|
});
|
||||||
|
|
||||||
this.view.$resultsContainer.show();
|
this.view.$resultsContainer.show();
|
||||||
|
this.scrollToSelectedResult(selectedInd);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -382,7 +379,11 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiSearchEnd: function () {
|
onApiSearchEnd: function () {
|
||||||
this.removeResultItems('stop');
|
if (!this._state.isContentChanged) {
|
||||||
|
this._state.isContentChanged = true;
|
||||||
|
this.view.updateResultsNumber('content-changed');
|
||||||
|
this.view.disableReplaceButtons(true);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiTextReplaced: function(found, replaced) {
|
onApiTextReplaced: function(found, replaced) {
|
||||||
|
|
|
@ -561,6 +561,8 @@
|
||||||
"Common.Views.SearchPanel.textWholeWords": "Whole words only",
|
"Common.Views.SearchPanel.textWholeWords": "Whole words only",
|
||||||
"Common.Views.SearchPanel.tipNextResult": "Next result",
|
"Common.Views.SearchPanel.tipNextResult": "Next result",
|
||||||
"Common.Views.SearchPanel.tipPreviousResult": "Previous result",
|
"Common.Views.SearchPanel.tipPreviousResult": "Previous result",
|
||||||
|
"Common.Views.SearchPanel.textContentChanged": "Document changed.",
|
||||||
|
"Common.Views.SearchPanel.textSearchAgain": "{0}Perform new search{1} for accurate results.",
|
||||||
"Common.Views.SelectFileDlg.textLoading": "Loading",
|
"Common.Views.SelectFileDlg.textLoading": "Loading",
|
||||||
"Common.Views.SelectFileDlg.textTitle": "Select Data Source",
|
"Common.Views.SelectFileDlg.textTitle": "Select Data Source",
|
||||||
"Common.Views.SignDialog.textBold": "Bold",
|
"Common.Views.SignDialog.textBold": "Bold",
|
||||||
|
|
|
@ -692,7 +692,7 @@ define([
|
||||||
if (this.isSearchPanelVisible()) {
|
if (this.isSearchPanelVisible()) {
|
||||||
selectedText && this.leftMenu.panelSearch.setFindText(selectedText);
|
selectedText && this.leftMenu.panelSearch.setFindText(selectedText);
|
||||||
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
||||||
this.leftMenu.fireEvent('search:aftershow', [selectedText]);
|
this.leftMenu.fireEvent('search:aftershow', [selectedText ? selectedText : undefined]);
|
||||||
return false;
|
return false;
|
||||||
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
||||||
var viewport = this.getApplication().getController('Viewport');
|
var viewport = this.getApplication().getController('Viewport');
|
||||||
|
@ -708,10 +708,10 @@ define([
|
||||||
Common.NotificationCenter.trigger('search:show');
|
Common.NotificationCenter.trigger('search:show');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.onShowHideSearch(true, selectedText);
|
this.onShowHideSearch(true, selectedText ? selectedText : undefined);
|
||||||
}
|
}
|
||||||
this.leftMenu.btnSearchBar.toggle(true,true);
|
this.leftMenu.btnSearchBar.toggle(true,true);
|
||||||
this.leftMenu.panelSearch.focus(selectedText !== '' ? s : 'search');
|
this.leftMenu.panelSearch.focus(selectedText ? s : 'search');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'save':
|
case 'save':
|
||||||
|
|
|
@ -153,8 +153,10 @@ define([
|
||||||
this._state.withinSheet = value === 0 ? Asc.c_oAscSearchBy.Sheet : (value === 1 ? Asc.c_oAscSearchBy.Workbook : Asc.c_oAscSearchBy.Range);
|
this._state.withinSheet = value === 0 ? Asc.c_oAscSearchBy.Sheet : (value === 1 ? Asc.c_oAscSearchBy.Workbook : Asc.c_oAscSearchBy.Range);
|
||||||
this.view.inputSelectRange.setDisabled(value !== Asc.c_oAscSearchBy.Range);
|
this.view.inputSelectRange.setDisabled(value !== Asc.c_oAscSearchBy.Range);
|
||||||
if (value === Asc.c_oAscSearchBy.Range) {
|
if (value === Asc.c_oAscSearchBy.Range) {
|
||||||
runSearch = false;
|
runSearch = this._state.isValidSelectedRange && !!this._state.selectedRange;
|
||||||
}
|
}
|
||||||
|
this.view.inputSelectRange.$el[value === Asc.c_oAscSearchBy.Range ? 'show' : 'hide']();
|
||||||
|
this.view.updateResultsContainerHeight();
|
||||||
break;
|
break;
|
||||||
case 'range':
|
case 'range':
|
||||||
this._state.selectedRange = value;
|
this._state.selectedRange = value;
|
||||||
|
@ -257,8 +259,11 @@ define([
|
||||||
options.asc_setScanByRows(this._state.searchByRows);
|
options.asc_setScanByRows(this._state.searchByRows);
|
||||||
options.asc_setLookIn(this._state.lookInFormulas ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
options.asc_setLookIn(this._state.lookInFormulas ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
||||||
options.asc_setNeedRecalc(isNeedRecalc);
|
options.asc_setNeedRecalc(isNeedRecalc);
|
||||||
this._state.isContentChanged && options.asc_setLastSearchElem(this._state.lastSelectedItem);
|
if (this._state.isContentChanged) {
|
||||||
|
options.asc_setLastSearchElem(this._state.lastSelectedItem);
|
||||||
|
this.view.disableReplaceButtons(false);
|
||||||
this._state.isContentChanged = false;
|
this._state.isContentChanged = false;
|
||||||
|
}
|
||||||
if (!this.api.asc_findText(options)) {
|
if (!this.api.asc_findText(options)) {
|
||||||
this.removeResultItems();
|
this.removeResultItems();
|
||||||
return false;
|
return false;
|
||||||
|
@ -271,10 +276,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onQueryReplace: function(textSearch, textReplace) {
|
onQueryReplace: function(textSearch, textReplace) {
|
||||||
if (this._state.isContentChanged) {
|
|
||||||
this.onQuerySearch();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.api.isReplaceAll = false;
|
this.api.isReplaceAll = false;
|
||||||
var options = new Asc.asc_CFindOptions();
|
var options = new Asc.asc_CFindOptions();
|
||||||
options.asc_setFindWhat(textSearch);
|
options.asc_setFindWhat(textSearch);
|
||||||
|
@ -293,10 +294,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onQueryReplaceAll: function(textSearch, textReplace) {
|
onQueryReplaceAll: function(textSearch, textReplace) {
|
||||||
if (this._state.isContentChanged) {
|
|
||||||
this.onQuerySearch();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.api.isReplaceAll = true;
|
this.api.isReplaceAll = true;
|
||||||
var options = new Asc.asc_CFindOptions();
|
var options = new Asc.asc_CFindOptions();
|
||||||
options.asc_setFindWhat(textSearch);
|
options.asc_setFindWhat(textSearch);
|
||||||
|
@ -545,6 +542,7 @@ define([
|
||||||
onApiModifiedDocument: function () {
|
onApiModifiedDocument: function () {
|
||||||
this._state.isContentChanged = true;
|
this._state.isContentChanged = true;
|
||||||
this.view.updateResultsNumber('content-changed');
|
this.view.updateResultsNumber('content-changed');
|
||||||
|
this.view.disableReplaceButtons(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onActiveSheetChanged: function (index) {
|
onActiveSheetChanged: function (index) {
|
||||||
|
|
|
@ -423,8 +423,8 @@
|
||||||
"Common.Views.SearchPanel.textWorkbook": "Workbook",
|
"Common.Views.SearchPanel.textWorkbook": "Workbook",
|
||||||
"Common.Views.SearchPanel.tipNextResult": "Next result",
|
"Common.Views.SearchPanel.tipNextResult": "Next result",
|
||||||
"Common.Views.SearchPanel.tipPreviousResult": "Previous result",
|
"Common.Views.SearchPanel.tipPreviousResult": "Previous result",
|
||||||
"Common.Views.SearchPanel.textContentChanged": "Document content has changed.",
|
"Common.Views.SearchPanel.textContentChanged": "Document changed.",
|
||||||
"Common.Views.SearchPanel.textSearchAgain": "{0}Search again{1} to make sure the results are current.",
|
"Common.Views.SearchPanel.textSearchAgain": "{0}Perform new search{1} for accurate results.",
|
||||||
"Common.Views.SelectFileDlg.textLoading": "Loading",
|
"Common.Views.SelectFileDlg.textLoading": "Loading",
|
||||||
"Common.Views.SelectFileDlg.textTitle": "Select Data Source",
|
"Common.Views.SelectFileDlg.textTitle": "Select Data Source",
|
||||||
"Common.Views.SignDialog.textBold": "Bold",
|
"Common.Views.SignDialog.textBold": "Bold",
|
||||||
|
|
|
@ -772,7 +772,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search-items {
|
.search-items {
|
||||||
height: calc(100% - 24px);
|
height: calc(100% - 28px);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 28px;
|
top: 28px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
Loading…
Reference in a new issue