[DE PE SSE] New search: hide settings in view mode
This commit is contained in:
parent
3a774f6546
commit
2ac854edc4
|
@ -1,6 +1,6 @@
|
|||
<div id="search-box" class="layout-ct vbox search-panel">
|
||||
<div id="search-header">
|
||||
<label><%= headerText %></label>
|
||||
<label id="search-adv-title"></label>
|
||||
<div id="search-btn-close"></div>
|
||||
</div>
|
||||
<div id="search-adv-settings">
|
||||
|
@ -9,7 +9,7 @@
|
|||
<tr>
|
||||
<td class="padding-small"><div id="search-adv-text"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="edit-setting">
|
||||
<td class="padding-large"><div id="search-adv-replace-text"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="edit-setting">
|
||||
<td class="padding-large">
|
||||
<button type="button" class="btn btn-text-default" id="search-adv-replace" style="display: inline-block; min-width: 62px;" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%= scope.textReplace %></button>
|
||||
<button type="button" class="btn btn-text-default" id="search-adv-replace-all" style="display: inline-block; min-width: 78px;" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%= scope.textReplaceAll %></button>
|
||||
|
|
|
@ -51,8 +51,7 @@ define([
|
|||
_.extend(this, options);
|
||||
Common.UI.BaseView.prototype.initialize.call(this, arguments);
|
||||
|
||||
this.isEdit = options.mode.isEdit;
|
||||
|
||||
this.mode = false;
|
||||
|
||||
window.SSE && (this.extendedOptions = Common.localStorage.getBool('sse-search-options-extended', true));
|
||||
},
|
||||
|
@ -61,8 +60,7 @@ define([
|
|||
if (!this.rendered) {
|
||||
el = el || this.el;
|
||||
$(el).html(this.template({
|
||||
scope: this,
|
||||
headerText: this.isEdit ? this.textFindAndReplace : this.textFind
|
||||
scope: this
|
||||
}));
|
||||
this.$el = $(el);
|
||||
|
||||
|
@ -129,15 +127,6 @@ define([
|
|||
dataHintOffset: 'small'
|
||||
});
|
||||
|
||||
this.chMatchWord = new Common.UI.CheckBox({
|
||||
el: $('#search-adv-match-word'),
|
||||
labelText: this.options.matchwordstr || this.textWholeWords,
|
||||
value: false,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'left',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
|
||||
this.buttonClose = new Common.UI.Button({
|
||||
parentEl: $('#search-btn-close', this.$el),
|
||||
cls: 'btn-toolbar',
|
||||
|
@ -147,6 +136,14 @@ define([
|
|||
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
|
||||
|
||||
if (window.SSE) {
|
||||
this.chMatchWord = new Common.UI.CheckBox({
|
||||
el: $('#search-adv-match-word'),
|
||||
labelText: this.options.matchwordstr || this.textWholeWords,
|
||||
value: false,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'left',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
|
||||
this.cmbWithin = new Common.UI.ComboBox({
|
||||
el: $('#search-adv-cmb-within'),
|
||||
|
@ -221,6 +218,14 @@ define([
|
|||
}, 10);
|
||||
},
|
||||
|
||||
setSearchMode: function (mode) {
|
||||
if (this.mode !== mode) {
|
||||
this.$el.find('.edit-setting')[mode !== 'no-replace' ? 'show' : 'hide']();
|
||||
this.$el.find('#search-adv-title').text(mode !== 'no-replace' ? this.textFindAndReplace : this.textFind);
|
||||
this.mode = mode;
|
||||
}
|
||||
},
|
||||
|
||||
ChangeSettings: function(props) {
|
||||
},
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ define([
|
|||
onLaunch: function() {
|
||||
this.leftMenu = this.createView('LeftMenu').render();
|
||||
this.leftMenu.btnSearch.on('toggle', _.bind(this.onMenuSearch, this));
|
||||
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
||||
|
||||
Common.util.Shortcuts.delegateShortcuts({
|
||||
shortcuts: {
|
||||
|
@ -666,6 +667,8 @@ define([
|
|||
this.viewmode = mode;
|
||||
|
||||
this.dlgSearch && this.dlgSearch.setMode(this.viewmode ? 'no-replace' : 'search');
|
||||
|
||||
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
||||
},
|
||||
|
||||
SetDisabled: function(disable, options) {
|
||||
|
@ -918,9 +921,11 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onShowHideSearch: function (state) {
|
||||
onShowHideSearch: function (state, action) {
|
||||
if (state) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
|
||||
this.leftMenu.panelSearch.setSearchMode(mode);
|
||||
this.leftMenu.showMenu('advancedsearch');
|
||||
} else {
|
||||
this.leftMenu.btnSearchBar.toggle(false, true);
|
||||
|
@ -928,6 +933,13 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onMenuSearchBar: function(obj, show) {
|
||||
if (show) {
|
||||
var mode = this.mode.isEdit && !this.viewmode ? undefined : 'no-replace';
|
||||
this.leftMenu.panelSearch.setSearchMode(mode);
|
||||
}
|
||||
},
|
||||
|
||||
isCommentsVisible: function() {
|
||||
return this.leftMenu && this.leftMenu.panelComments && this.leftMenu.panelComments.isVisible();
|
||||
},
|
||||
|
|
|
@ -124,6 +124,7 @@ define([
|
|||
this.leftMenu.btnSearch.on('toggle', _.bind(this.onMenuSearch, this));
|
||||
this.leftMenu.btnThumbs.on('toggle', _.bind(this.onShowTumbnails, this));
|
||||
this.isThumbsShown = true;
|
||||
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
||||
|
||||
Common.util.Shortcuts.delegateShortcuts({
|
||||
shortcuts: {
|
||||
|
@ -537,6 +538,8 @@ define([
|
|||
this.viewmode = mode;
|
||||
|
||||
this.dlgSearch && this.dlgSearch.setMode(this.viewmode ? 'no-replace' : 'search');
|
||||
|
||||
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
||||
},
|
||||
|
||||
onApiServerDisconnect: function(enableDownload) {
|
||||
|
@ -771,9 +774,11 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onShowHideSearch: function (state) {
|
||||
onShowHideSearch: function (state, action) {
|
||||
if (state) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
|
||||
this.leftMenu.panelSearch.setSearchMode(mode);
|
||||
this.leftMenu.showMenu('advancedsearch');
|
||||
} else {
|
||||
this.leftMenu.btnSearchBar.toggle(false, true);
|
||||
|
@ -781,6 +786,13 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onMenuSearchBar: function(obj, show) {
|
||||
if (show) {
|
||||
var mode = this.mode.isEdit && !this.viewmode ? undefined : 'no-replace';
|
||||
this.leftMenu.panelSearch.setSearchMode(mode);
|
||||
}
|
||||
},
|
||||
|
||||
showHistory: function() {
|
||||
if (!this.mode.wopi) {
|
||||
var maincontroller = PE.getController('Main');
|
||||
|
|
|
@ -116,6 +116,7 @@ define([
|
|||
onLaunch: function() {
|
||||
this.leftMenu = this.createView('LeftMenu').render();
|
||||
this.leftMenu.btnSearch.on('toggle', _.bind(this.onMenuSearch, this));
|
||||
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
||||
|
||||
Common.util.Shortcuts.delegateShortcuts({
|
||||
shortcuts: {
|
||||
|
@ -722,6 +723,8 @@ define([
|
|||
this.viewmode = mode;
|
||||
|
||||
this.dlgSearch && this.dlgSearch.setMode(this.viewmode ? 'no-replace' : 'search');
|
||||
|
||||
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
||||
},
|
||||
|
||||
onApiServerDisconnect: function(enableDownload) {
|
||||
|
@ -980,9 +983,11 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onShowHideSearch: function (state) {
|
||||
onShowHideSearch: function (state, action) {
|
||||
if (state) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
|
||||
this.leftMenu.panelSearch.setSearchMode(mode);
|
||||
this.leftMenu.showMenu('advancedsearch');
|
||||
} else {
|
||||
this.leftMenu.btnSearchBar.toggle(false, true);
|
||||
|
@ -990,6 +995,13 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onMenuSearchBar: function(obj, show) {
|
||||
if (show) {
|
||||
var mode = this.mode.isEdit && !this.viewmode ? undefined : 'no-replace';
|
||||
this.leftMenu.panelSearch.setSearchMode(mode);
|
||||
}
|
||||
},
|
||||
|
||||
onMenuChange: function (value) {
|
||||
if ('hide' === value) {
|
||||
if (this.leftMenu.btnComments.isActive() && this.api) {
|
||||
|
|
Loading…
Reference in a new issue