Commit 225120e0 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Bug 25965, 21666: при попытке печати всегда показывать окно с настройками печати.

parent 152cd455
......@@ -155,7 +155,7 @@ define([
case 'back': break;
case 'save': this.api.asc_Save(); break;
case 'save-desktop': this.api.asc_DownloadAs(); break;
case 'print': this.api.asc_Print(undefined, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); break;
case 'print': Common.NotificationCenter.trigger('print', this.leftMenu); break;
case 'exit': Common.NotificationCenter.trigger('goback'); break;
case 'edit':
// this.getApplication().getController('Statusbar').setStatusCaption(this.requestEditRightsText);
......
......@@ -761,6 +761,10 @@ define([
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram) {
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
var printController = app.getController('Print');
printController && this.api && printController.setApi(this.api);
}
var celleditorController = this.getApplication().getController('CellEditor');
......@@ -774,7 +778,6 @@ define([
toolbarController = application.getController('Toolbar'),
statusbarController = application.getController('Statusbar'),
rightmenuController = application.getController('RightMenu'),
printController = application.getController('Print'),
/** coauthoring begin **/
commentsController = application.getController('Common.Controllers.Comments'),
/** coauthoring end **/
......@@ -794,7 +797,6 @@ define([
}
rightmenuController && rightmenuController.setApi(me.api);
printController && printController.setApi(me.api);
if (statusbarController) {
statusbarController.getView('Statusbar').changeViewMode(true);
......@@ -1604,10 +1606,7 @@ define([
onPrint: function() {
if (!this.appOptions.canPrint) return;
if (this.api)
this.api.asc_Print(undefined, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event
Common.component.Analytics.trackEvent('Print');
Common.NotificationCenter.trigger('print', this);
},
onPrintUrl: function(url) {
......
......@@ -37,9 +37,7 @@ define([
onAfterRender: function(view) {
this.printSettings.cmbSheet.on('selected', _.bind(this.comboSheetsChange, this, this.printSettings));
this.printSettings.btnOk.on('click', _.bind(this.querySavePrintSettings, this));
var toolbar = SSE.getController('Toolbar').getView('Toolbar');
if (toolbar)
toolbar.mnuPrint.on('item:click', _.bind(this.openPrintSettings, this));
Common.NotificationCenter.on('print', _.bind(this.openPrintSettings, this));
this.registerControlEvents(this.printSettings);
},
......@@ -189,8 +187,8 @@ define([
}
},
openPrintSettings: function(menu, item) {
if (item.value === 'options' && this.api ) {
openPrintSettings: function(btn) {
if (this.api) {
this.printSettingsDlg = (new SSE.Views.PrintSettings({
handler: _.bind(this.resultPrintSettings,this),
afterrender: _.bind(function() {
......@@ -216,6 +214,9 @@ define([
Common.localStorage.setItem("sse-print-settings-range", printtype);
this.api.asc_Print(this.adjPrintParams, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera);
Common.component.Analytics.trackEvent('Print');
Common.component.Analytics.trackEvent('ToolBar', 'Print');
Common.NotificationCenter.trigger('edit:complete', view);
} else
return true;
......
......@@ -136,7 +136,6 @@ define([
toolbar.btnNewDocument.on('click', _.bind(this.onNewDocument, this));
toolbar.btnOpenDocument.on('click', _.bind(this.onOpenDocument, this));
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
toolbar.btnPrint.menu.on('item:click', _.bind(this.onPrintMenu, this));
toolbar.btnSave.on('click', _.bind(this.onSave, this));
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
......@@ -258,25 +257,7 @@ define([
},
onPrint: function(e) {
if (this.api) {
this.api.asc_Print(undefined, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); // if isChrome or isSafari == true use asc_onPrintUrl event
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('Print');
Common.component.Analytics.trackEvent('ToolBar', 'Print');
}
},
onPrintMenu: function(menu, item) {
if (item.value === 'print' && this.api) {
this.api.asc_Print(undefined, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('Print');
Common.component.Analytics.trackEvent('ToolBar', 'Print');
}
Common.NotificationCenter.trigger('print', this.toolbar);
},
onSave: function(e) {
......
......@@ -165,21 +165,8 @@ define([
id : 'id-toolbar-btn-print',
cls : 'btn-toolbar',
iconCls : 'btn-print',
split : true,
hint : me.tipPrint + Common.Utils.String.platformKey('Ctrl+P'),
lock : [_set.editCell, _set.cantPrint],
menu : new Common.UI.Menu({
items: [
{
caption: me.textPrint,
value: 'print'
},
{
caption: me.textPrintOptions,
value: 'options'
}
]
})
lock : [_set.editCell, _set.cantPrint]
});
me.btnSave = new Common.UI.Button({
......@@ -1470,8 +1457,6 @@ define([
})
});
me.mnuPrint = me.btnPrint.menu;
me.lockControls = [
me.cmbFontName, me.cmbFontSize, me.btnIncFontSize, me.btnDecFontSize, me.btnBold,
me.btnItalic, me.btnUnderline, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment