[DE] Add pages count to document.

This commit is contained in:
Julia Radzhabova 2016-10-04 15:05:12 +03:00
parent 10271fa79c
commit 71390d54be
3 changed files with 19 additions and 1 deletions

View file

@ -252,6 +252,7 @@ define([
toolbar.mnuPageNumberPosPicker.on('item:click', _.bind(this.onInsertPageNumberClick, this));
toolbar.btnEditHeader.menu.on('item:click', _.bind(this.onEditHeaderFooterClick, this));
toolbar.mnuPageNumCurrentPos.on('click', _.bind(this.onPageNumCurrentPosClick, this));
toolbar.mnuInsertPageCount.on('click', _.bind(this.onInsertPageCountClick, this));
toolbar.listStyles.on('click', _.bind(this.onListStyleSelect, this));
toolbar.listStyles.on('contextmenu', _.bind(this.onListStyleContextMenu, this));
toolbar.styleMenu.on('hide:before', _.bind(this.onListStyleBeforeHide, this));
@ -1698,6 +1699,14 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Page Number');
},
onInsertPageCountClick: function(item, e) {
if (this.api)
this.api.asc_AddPageCount();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Pages Count');
},
onEditHeaderFooterClick: function(menu, item) {
if (this.api) {

View file

@ -555,7 +555,9 @@ define([
};
this.mnuPageNumCurrentPos = clone(this.mnuPageNumberPosPicker);
this.mnuInsertPageNum = clone(this.mnuPageNumberPosPicker);
this.mnuInsertPageCount = clone(this.mnuPageNumberPosPicker);
this.paragraphControls.push(this.mnuPageNumCurrentPos);
this.paragraphControls.push(this.mnuInsertPageCount);
this.toolbarControls.push(this.btnEditHeader);
this.btnInsertShape = new Common.UI.Button({
@ -1262,11 +1264,16 @@ define([
})
]
})
}),
this.mnuInsertPageCount = new Common.UI.MenuItem({
caption: this.textInsertPageCount,
disabled: this.mnuInsertPageCount.isDisabled()
})
]
})
);
this.paragraphControls.push(this.mnuPageNumCurrentPos);
this.paragraphControls.push(this.mnuInsertPageCount);
this.mnuZoomOut = new Common.UI.Button({
el : $('#id-menu-zoom-out'),
@ -1900,7 +1907,8 @@ define([
textRight: 'Right: ',
textPageSizeCustom: 'Custom Page Size',
textPortrait: 'Portrait',
textLandscape: 'Landscape'
textLandscape: 'Landscape',
textInsertPageCount: 'Insert number of pages'
}, DE.Views.Toolbar || {}));
});

View file

@ -1443,6 +1443,7 @@
"DE.Views.Toolbar.textHideTitleBar": "Hide Title Bar",
"DE.Views.Toolbar.textInMargin": "In Margin",
"DE.Views.Toolbar.textInsColumnBreak": "Insert Column Break",
"DE.Views.Toolbar.textInsertPageCount": "Insert number of pages",
"DE.Views.Toolbar.textInsertPageNumber": "Insert page number",
"DE.Views.Toolbar.textInsPageBreak": "Insert Page Break",
"DE.Views.Toolbar.textInsSectionBreak": "Insert Section Break",