QuickPrint for compactHeader
This commit is contained in:
parent
7e7f519caf
commit
fc8e344dd9
|
@ -372,6 +372,7 @@ define([
|
||||||
Common.Gateway.on('setmailmergerecipients', _.bind(this.setMailMergeRecipients, this));
|
Common.Gateway.on('setmailmergerecipients', _.bind(this.setMailMergeRecipients, this));
|
||||||
$('#id-toolbar-menu-new-control-color').on('click', _.bind(this.onNewControlsColor, this));
|
$('#id-toolbar-menu-new-control-color').on('click', _.bind(this.onNewControlsColor, this));
|
||||||
toolbar.listStylesAdditionalMenuItem.on('click', this.onMenuSaveStyle.bind(this));
|
toolbar.listStylesAdditionalMenuItem.on('click', this.onMenuSaveStyle.bind(this));
|
||||||
|
toolbar.btnPrint.menu && toolbar.btnPrint.menu.on('item:click', _.bind(this.onPrintMenu, this));
|
||||||
|
|
||||||
this.onSetupCopyStyleButton();
|
this.onSetupCopyStyleButton();
|
||||||
this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled());
|
this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled());
|
||||||
|
@ -1061,11 +1062,35 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onPrint: function(e) {
|
onPrint: function(e) {
|
||||||
Common.NotificationCenter.trigger('file:print', this.toolbar);
|
if (this.toolbar.btnPrint.options.printType == 'print') {
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('file:print', this.toolbar);
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
|
} else {
|
||||||
|
var _main = this.getApplication().getController('Main');
|
||||||
|
_main.onPrintQuick();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Common.component.Analytics.trackEvent('Print');
|
Common.component.Analytics.trackEvent('Print');
|
||||||
Common.component.Analytics.trackEvent('ToolBar', 'Print');
|
Common.component.Analytics.trackEvent('ToolBar', 'Print');
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onPrintMenu: function (btn, e){
|
||||||
|
var oldType = this.toolbar.btnPrint.options.printType;
|
||||||
|
var newType = e.value;
|
||||||
|
//this.toolbar.btnPrint.toggle(true);
|
||||||
|
|
||||||
|
if(newType != oldType) {
|
||||||
|
this.toolbar.btnPrint.changeIcon({
|
||||||
|
next: e.options.iconClsForMainBtn,
|
||||||
|
curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn
|
||||||
|
});
|
||||||
|
this.toolbar.btnPrint.updateHint([e.caption, this.views.Toolbar.prototype.tipInsertText]);
|
||||||
|
this.toolbar.btnPrint.options.printType = newType;
|
||||||
|
}
|
||||||
|
this.onPrint(e);
|
||||||
},
|
},
|
||||||
|
|
||||||
onSave: function(e) {
|
onSave: function(e) {
|
||||||
|
|
|
@ -192,8 +192,11 @@ define([
|
||||||
lock: [_set.cantPrint, _set.disableOnStart],
|
lock: [_set.cantPrint, _set.disableOnStart],
|
||||||
signals: ['disabled'],
|
signals: ['disabled'],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
|
split: config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false),
|
||||||
|
menu: config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false),
|
||||||
dataHintDirection: 'top',
|
dataHintDirection: 'top',
|
||||||
dataHintTitle: 'P'
|
dataHintTitle: 'P',
|
||||||
|
printType: 'print'
|
||||||
});
|
});
|
||||||
this.toolbarControls.push(this.btnPrint);
|
this.toolbarControls.push(this.btnPrint);
|
||||||
|
|
||||||
|
@ -1744,6 +1747,28 @@ define([
|
||||||
})).then(function () {
|
})).then(function () {
|
||||||
if ( !config.isEdit ) return;
|
if ( !config.isEdit ) return;
|
||||||
|
|
||||||
|
if(me.btnPrint && config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false)){
|
||||||
|
me.btnPrint.setMenu(
|
||||||
|
new Common.UI.Menu({
|
||||||
|
items:[
|
||||||
|
{
|
||||||
|
caption: 'Print',
|
||||||
|
iconCls: 'menu__icon btn-print',
|
||||||
|
toggleGroup: 'viewPrint',
|
||||||
|
value: 'print',
|
||||||
|
iconClsForMainBtn: 'btn-print'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: 'QuickPrint',
|
||||||
|
iconCls: 'menu__icon btn-quick-print',
|
||||||
|
toggleGroup: 'viewPrint',
|
||||||
|
value: 'print-quick',
|
||||||
|
iconClsForMainBtn: 'btn-quick-print'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
me.btnsPageBreak.forEach( function(btn) {
|
me.btnsPageBreak.forEach( function(btn) {
|
||||||
btn.updateHint( [me.textInsPageBreak, me.tipPageBreak] );
|
btn.updateHint( [me.textInsPageBreak, me.tipPageBreak] );
|
||||||
|
|
||||||
|
@ -2030,6 +2055,7 @@ define([
|
||||||
ids.push('id-toolbar-menu-markers-level-' + i);
|
ids.push('id-toolbar-menu-markers-level-' + i);
|
||||||
items.push({template: levelTemplate, previewId: ids[i], level: i, checkable: true });
|
items.push({template: levelTemplate, previewId: ids[i], level: i, checkable: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.btnMarkers.setMenu(
|
this.btnMarkers.setMenu(
|
||||||
new Common.UI.Menu({
|
new Common.UI.Menu({
|
||||||
cls: 'shifted-left',
|
cls: 'shifted-left',
|
||||||
|
|
Loading…
Reference in a new issue