[SSE] Open print with preview from toolbar, remove unused code
This commit is contained in:
parent
8e9d5dcea0
commit
79bf7d21bb
|
@ -107,6 +107,7 @@ define([
|
||||||
if ( !this.leftMenu.panelHistory.isVisible() )
|
if ( !this.leftMenu.panelHistory.isVisible() )
|
||||||
this.clickMenuFileItem(null, 'history');
|
this.clickMenuFileItem(null, 'history');
|
||||||
}, this));
|
}, this));
|
||||||
|
Common.NotificationCenter.on('file:print', _.bind(this.clickToolbarPrint, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
|
@ -534,6 +535,10 @@ define([
|
||||||
this.leftMenu.menuFile.hide();
|
this.leftMenu.menuFile.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clickToolbarPrint: function () {
|
||||||
|
this.leftMenu.showMenu('file:printpreview');
|
||||||
|
},
|
||||||
|
|
||||||
changeToolbarSaveState: function (state) {
|
changeToolbarSaveState: function (state) {
|
||||||
var btnSave = this.leftMenu.menuFile.getButton('save');
|
var btnSave = this.leftMenu.menuFile.getButton('save');
|
||||||
btnSave && btnSave.setDisabled(state);
|
btnSave && btnSave.setDisabled(state);
|
||||||
|
|
|
@ -2639,7 +2639,7 @@ define([
|
||||||
|
|
||||||
onPrint: function() {
|
onPrint: function() {
|
||||||
if (!this.appOptions.canPrint || Common.Utils.ModalWindow.isVisible()) return;
|
if (!this.appOptions.canPrint || Common.Utils.ModalWindow.isVisible()) return;
|
||||||
Common.NotificationCenter.trigger('print', this);
|
Common.NotificationCenter.trigger('file:print', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onPrintUrl: function(url) {
|
onPrintUrl: function(url) {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<li id="fm-btn-download" class="fm-btn"></li>
|
<li id="fm-btn-download" class="fm-btn"></li>
|
||||||
<li id="fm-btn-save-copy" class="fm-btn"></li>
|
<li id="fm-btn-save-copy" class="fm-btn"></li>
|
||||||
<li id="fm-btn-save-desktop" class="fm-btn"></li>
|
<li id="fm-btn-save-desktop" class="fm-btn"></li>
|
||||||
<li id="fm-btn-print" class="fm-btn"></li>
|
|
||||||
<li id="fm-btn-print-with-preview" class="fm-btn"></li>
|
<li id="fm-btn-print-with-preview" class="fm-btn"></li>
|
||||||
<li id="fm-btn-rename" class="fm-btn"></li>
|
<li id="fm-btn-rename" class="fm-btn"></li>
|
||||||
<li id="fm-btn-protect" class="fm-btn"></li>
|
<li id="fm-btn-protect" class="fm-btn"></li>
|
||||||
|
|
|
@ -129,19 +129,9 @@ define([
|
||||||
dataHintOffset: [2, 14]
|
dataHintOffset: [2, 14]
|
||||||
});
|
});
|
||||||
|
|
||||||
this.miPrint = new Common.UI.MenuItem({
|
|
||||||
el : $markup.elementById('#fm-btn-print'),
|
|
||||||
action : 'print',
|
|
||||||
caption : this.btnPrintCaption,
|
|
||||||
canFocused: false,
|
|
||||||
dataHint: 1,
|
|
||||||
dataHintDirection: 'left-top',
|
|
||||||
dataHintOffset: [2, 14]
|
|
||||||
});
|
|
||||||
|
|
||||||
this.miPrintWithPreview = new Common.UI.MenuItem({
|
this.miPrintWithPreview = new Common.UI.MenuItem({
|
||||||
el : $markup.elementById('#fm-btn-print-with-preview'),
|
el : $markup.elementById('#fm-btn-print-with-preview'),
|
||||||
action : 'print-with-preview',
|
action : 'printpreview',
|
||||||
caption : this.btnPrintCaption,
|
caption : this.btnPrintCaption,
|
||||||
canFocused: false,
|
canFocused: false,
|
||||||
dataHint: 1,
|
dataHint: 1,
|
||||||
|
@ -253,7 +243,6 @@ define([
|
||||||
this.miDownload,
|
this.miDownload,
|
||||||
this.miSaveCopyAs,
|
this.miSaveCopyAs,
|
||||||
this.miSaveAs,
|
this.miSaveAs,
|
||||||
this.miPrint,
|
|
||||||
this.miPrintWithPreview,
|
this.miPrintWithPreview,
|
||||||
this.miRename,
|
this.miRename,
|
||||||
this.miProtect,
|
this.miProtect,
|
||||||
|
@ -353,7 +342,6 @@ define([
|
||||||
this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
|
this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
|
||||||
this.miSave[this.mode.isEdit?'show':'hide']();
|
this.miSave[this.mode.isEdit?'show':'hide']();
|
||||||
this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide']();
|
this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide']();
|
||||||
this.miPrint[this.mode.canPrint?'show':'hide']();
|
|
||||||
this.miPrintWithPreview[this.mode.canPrint?'show':'hide']();
|
this.miPrintWithPreview[this.mode.canPrint?'show':'hide']();
|
||||||
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
||||||
this.miProtect[this.mode.canProtect ?'show':'hide']();
|
this.miProtect[this.mode.canProtect ?'show':'hide']();
|
||||||
|
@ -422,7 +410,7 @@ define([
|
||||||
if (this.mode.canPrint) {
|
if (this.mode.canPrint) {
|
||||||
var printPanel = SSE.getController('Print').getView('PrintWithPreview');
|
var printPanel = SSE.getController('Print').getView('PrintWithPreview');
|
||||||
printPanel.menu = this;
|
printPanel.menu = this;
|
||||||
this.panels['print-with-preview'] = printPanel.render(this.$el.find('#panel-print'));
|
this.panels['printpreview'] = printPanel.render(this.$el.find('#panel-print'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue