[PE SSE] New search: add search bar window
This commit is contained in:
parent
468e51cc8e
commit
3a774f6546
|
@ -107,6 +107,9 @@ define([
|
|||
},
|
||||
'Common.Views.ReviewChanges': {
|
||||
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
||||
},
|
||||
'SearchBar': {
|
||||
'search:show': _.bind(this.onShowHideSearch, this)
|
||||
}
|
||||
});
|
||||
Common.NotificationCenter.on('leftmenu:change', _.bind(this.onMenuChange, this));
|
||||
|
@ -768,6 +771,16 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onShowHideSearch: function (state) {
|
||||
if (state) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
this.leftMenu.showMenu('advancedsearch');
|
||||
} else {
|
||||
this.leftMenu.btnSearchBar.toggle(false, true);
|
||||
this.leftMenu.onBtnMenuClick(this.leftMenu.btnSearchBar);
|
||||
}
|
||||
},
|
||||
|
||||
showHistory: function() {
|
||||
if (!this.mode.wopi) {
|
||||
var maincontroller = PE.getController('Main');
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
define([
|
||||
'core',
|
||||
'common/main/lib/view/Header',
|
||||
'common/main/lib/view/SearchBar',
|
||||
'presentationeditor/main/app/view/DocumentPreview',
|
||||
'presentationeditor/main/app/view/Viewport'
|
||||
// 'documenteditor/main/app/view/LeftMenu'
|
||||
|
@ -341,6 +342,7 @@ define([
|
|||
})).on('click', _on_btn_zoom.bind(me, 'up'));
|
||||
|
||||
me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
|
||||
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -512,6 +514,24 @@ define([
|
|||
Common.localStorage.setBool('pe-hidden-notes', !bIsShow);
|
||||
},
|
||||
|
||||
onSearchClick: function () {
|
||||
if (!this.searchBar) {
|
||||
this.searchBar = new Common.UI.SearchBar({});
|
||||
}
|
||||
if (this.header.btnSearch.pressed) {
|
||||
if (this.searchBar.isVisible()) {
|
||||
this.searchBar.focus();
|
||||
} else {
|
||||
this.searchBar.show();
|
||||
}
|
||||
} else {
|
||||
this.searchBar.hide();
|
||||
}
|
||||
this.searchBar.on('hide', _.bind(function () {
|
||||
this.header.btnSearch.toggle(false);
|
||||
}, this));
|
||||
},
|
||||
|
||||
textFitPage: 'Fit to Page',
|
||||
textFitWidth: 'Fit to Width'
|
||||
}, PE.Controllers.Viewport));
|
||||
|
|
|
@ -99,6 +99,9 @@ define([
|
|||
},
|
||||
'Common.Views.ReviewChanges': {
|
||||
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
||||
},
|
||||
'SearchBar': {
|
||||
'search:show': _.bind(this.onShowHideSearch, this)
|
||||
}
|
||||
});
|
||||
Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this));
|
||||
|
@ -977,6 +980,16 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onShowHideSearch: function (state) {
|
||||
if (state) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
this.leftMenu.showMenu('advancedsearch');
|
||||
} else {
|
||||
this.leftMenu.btnSearchBar.toggle(false, true);
|
||||
this.leftMenu.onBtnMenuClick(this.leftMenu.btnSearchBar);
|
||||
}
|
||||
},
|
||||
|
||||
onMenuChange: function (value) {
|
||||
if ('hide' === value) {
|
||||
if (this.leftMenu.btnComments.isActive() && this.api) {
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
define([
|
||||
'core',
|
||||
'common/main/lib/view/Header',
|
||||
'common/main/lib/view/SearchBar',
|
||||
'spreadsheeteditor/main/app/view/Viewport'
|
||||
// ,'spreadsheeteditor/main/app/view/LeftMenu'
|
||||
], function (Viewport) {
|
||||
|
@ -347,6 +348,7 @@ define([
|
|||
})).on('click', _on_btn_zoom.bind(me, 'up'));
|
||||
|
||||
me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
|
||||
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -542,6 +544,24 @@ define([
|
|||
this.header.mnuitemFreezePanes.setDisabled(disabled);
|
||||
},
|
||||
|
||||
onSearchClick: function () {
|
||||
if (!this.searchBar) {
|
||||
this.searchBar = new Common.UI.SearchBar({});
|
||||
}
|
||||
if (this.header.btnSearch.pressed) {
|
||||
if (this.searchBar.isVisible()) {
|
||||
this.searchBar.focus();
|
||||
} else {
|
||||
this.searchBar.show();
|
||||
}
|
||||
} else {
|
||||
this.searchBar.hide();
|
||||
}
|
||||
this.searchBar.on('hide', _.bind(function () {
|
||||
this.header.btnSearch.toggle(false);
|
||||
}, this));
|
||||
},
|
||||
|
||||
textHideFBar: 'Hide Formula Bar',
|
||||
textHideHeadings: 'Hide Headings',
|
||||
textHideGridlines: 'Hide Gridlines',
|
||||
|
|
Loading…
Reference in a new issue