[DE] Fix search in edit mail merge mode
This commit is contained in:
parent
e9a0798327
commit
57443701d6
|
@ -50,7 +50,8 @@ define([
|
||||||
height: 54,
|
height: 54,
|
||||||
header: false,
|
header: false,
|
||||||
cls: 'search-bar',
|
cls: 'search-bar',
|
||||||
alias: 'SearchBar'
|
alias: 'SearchBar',
|
||||||
|
showOpenPanel: true
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
|
@ -62,7 +63,7 @@ define([
|
||||||
'<div class="tools">',
|
'<div class="tools">',
|
||||||
'<div id="search-bar-back"></div>',
|
'<div id="search-bar-back"></div>',
|
||||||
'<div id="search-bar-next"></div>',
|
'<div id="search-bar-next"></div>',
|
||||||
'<div id="search-bar-open-panel"></div>',
|
this.options.showOpenPanel ? '<div id="search-bar-open-panel"></div>' : '',
|
||||||
'<div id="search-bar-close"></div>',
|
'<div id="search-bar-close"></div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
|
@ -103,6 +104,7 @@ define([
|
||||||
});
|
});
|
||||||
this.btnNext.on('click', _.bind(this.onBtnNextClick, this, 'next'));
|
this.btnNext.on('click', _.bind(this.onBtnNextClick, this, 'next'));
|
||||||
|
|
||||||
|
if (this.options.showOpenPanel) {
|
||||||
this.btnOpenPanel = new Common.UI.Button({
|
this.btnOpenPanel = new Common.UI.Button({
|
||||||
parentEl: $('#search-bar-open-panel'),
|
parentEl: $('#search-bar-open-panel'),
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
|
@ -110,6 +112,7 @@ define([
|
||||||
hint: this.tipOpenAdvancedSettings
|
hint: this.tipOpenAdvancedSettings
|
||||||
});
|
});
|
||||||
this.btnOpenPanel.on('click', _.bind(this.onOpenPanel, this));
|
this.btnOpenPanel.on('click', _.bind(this.onOpenPanel, this));
|
||||||
|
}
|
||||||
|
|
||||||
this.btnClose = new Common.UI.Button({
|
this.btnClose = new Common.UI.Button({
|
||||||
parentEl: $('#search-bar-close'),
|
parentEl: $('#search-bar-close'),
|
||||||
|
|
|
@ -678,6 +678,10 @@ define([
|
||||||
switch (s) {
|
switch (s) {
|
||||||
case 'replace':
|
case 'replace':
|
||||||
case 'search':
|
case 'search':
|
||||||
|
if (this.mode.isEditMailMerge || this.mode.isEditOle) {
|
||||||
|
this.leftMenu.fireEvent('search:show');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!this.leftMenu.btnSearchBar.isDisabled()) {
|
if (!this.leftMenu.btnSearchBar.isDisabled()) {
|
||||||
Common.UI.Menu.Manager.hideAll();
|
Common.UI.Menu.Manager.hideAll();
|
||||||
this.leftMenu.btnAbout.toggle(false);
|
this.leftMenu.btnAbout.toggle(false);
|
||||||
|
@ -738,6 +742,11 @@ define([
|
||||||
btnSearch.pressed && btnSearch.toggle(false);
|
btnSearch.pressed && btnSearch.toggle(false);
|
||||||
this.leftMenu._state.isSearchOpen && (this.leftMenu._state.isSearchOpen = false);
|
this.leftMenu._state.isSearchOpen && (this.leftMenu._state.isSearchOpen = false);
|
||||||
|
|
||||||
|
if (this.mode.isEditMailMerge || this.mode.isEditOle) {
|
||||||
|
btnSearch = this.getApplication().getController('Toolbar').toolbar.btnSearch;
|
||||||
|
btnSearch.pressed && btnSearch.toggle(false);
|
||||||
|
}
|
||||||
|
|
||||||
if ( this.leftMenu.menuFile.isVisible() ) {
|
if ( this.leftMenu.menuFile.isVisible() ) {
|
||||||
if (Common.UI.HintManager.needCloseFileMenu())
|
if (Common.UI.HintManager.needCloseFileMenu())
|
||||||
this.leftMenu.menuFile.hide();
|
this.leftMenu.menuFile.hide();
|
||||||
|
|
|
@ -47,6 +47,7 @@ define([
|
||||||
'common/main/lib/view/SymbolTableDialog',
|
'common/main/lib/view/SymbolTableDialog',
|
||||||
'common/main/lib/view/OptionsDialog',
|
'common/main/lib/view/OptionsDialog',
|
||||||
'common/main/lib/util/define',
|
'common/main/lib/util/define',
|
||||||
|
'common/main/lib/view/SearchBar',
|
||||||
'spreadsheeteditor/main/app/view/Toolbar',
|
'spreadsheeteditor/main/app/view/Toolbar',
|
||||||
'spreadsheeteditor/main/app/collection/TableTemplates',
|
'spreadsheeteditor/main/app/collection/TableTemplates',
|
||||||
'spreadsheeteditor/main/app/controller/PivotTable',
|
'spreadsheeteditor/main/app/controller/PivotTable',
|
||||||
|
@ -147,6 +148,9 @@ define([
|
||||||
},
|
},
|
||||||
'ViewTab': {
|
'ViewTab': {
|
||||||
'viewtab:showtoolbar': this.onChangeViewMode.bind(this)
|
'viewtab:showtoolbar': this.onChangeViewMode.bind(this)
|
||||||
|
},
|
||||||
|
'LeftMenu': {
|
||||||
|
'search:show': this.searchShow.bind(this)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Common.NotificationCenter.on('page:settings', _.bind(this.onApiSheetChanged, this));
|
Common.NotificationCenter.on('page:settings', _.bind(this.onApiSheetChanged, this));
|
||||||
|
@ -296,7 +300,7 @@ define([
|
||||||
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
||||||
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
||||||
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
||||||
toolbar.btnSearch.on('click', _.bind(this.onSearch, this));
|
toolbar.btnSearch.on('toggle', _.bind(this.onSearch, this));
|
||||||
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
|
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
|
||||||
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
|
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
|
||||||
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
|
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
|
||||||
|
@ -307,7 +311,7 @@ define([
|
||||||
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
||||||
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
||||||
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
||||||
toolbar.btnSearch.on('click', _.bind(this.onSearch, this));
|
toolbar.btnSearch.on('toggle', _.bind(this.onSearch, this));
|
||||||
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
|
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
|
||||||
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
|
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
|
||||||
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
|
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
|
||||||
|
@ -1282,8 +1286,27 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
searchShow: function () {
|
||||||
|
if (this.toolbar.btnSearch && this.searchBar && !this.searchBar.isVisible()) {
|
||||||
|
this.toolbar.btnSearch.toggle(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onSearch: function(type, btn) {
|
onSearch: function(type, btn) {
|
||||||
this.getApplication().getController('LeftMenu').showSearchDlg(true);
|
if (!this.searchBar) {
|
||||||
|
this.searchBar = new Common.UI.SearchBar({
|
||||||
|
showOpenPanel: false,
|
||||||
|
width: 303
|
||||||
|
});
|
||||||
|
this.searchBar.on('hide', _.bind(function () {
|
||||||
|
this.toolbar.btnSearch.toggle(false, true);
|
||||||
|
}, this));
|
||||||
|
}
|
||||||
|
if (this.toolbar.btnSearch.pressed) {
|
||||||
|
this.searchBar.show(this.api.asc_GetSelectedText());
|
||||||
|
} else {
|
||||||
|
this.searchBar.hide();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onAutoFilter: function(btn) {
|
onAutoFilter: function(btn) {
|
||||||
|
|
|
@ -349,6 +349,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-menu-search',
|
iconCls : 'toolbar__icon btn-menu-search',
|
||||||
lock : [_set.lostConnect],
|
lock : [_set.lostConnect],
|
||||||
|
enableToggle: true,
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue