[PE] Fix Bug 37499

This commit is contained in:
Julia Radzhabova 2018-08-08 12:01:21 +03:00
parent 8809dfc54b
commit eb908f5fc0
5 changed files with 46 additions and 12 deletions

View file

@ -99,7 +99,8 @@ define([
this.statusbar.btnZoomToPage.on('click', _.bind(this.onBtnZoomTo, this, 'topage')); this.statusbar.btnZoomToPage.on('click', _.bind(this.onBtnZoomTo, this, 'topage'));
this.statusbar.btnZoomToWidth.on('click', _.bind(this.onBtnZoomTo, this, 'towidth')); this.statusbar.btnZoomToWidth.on('click', _.bind(this.onBtnZoomTo, this, 'towidth'));
this.statusbar.zoomMenu.on('item:click', _.bind(this.menuZoomClick, this)); this.statusbar.zoomMenu.on('item:click', _.bind(this.menuZoomClick, this));
this.statusbar.btnPreview.on('click', _.bind(this.onPreview, this)); this.statusbar.btnPreview.on('click', _.bind(this.onPreviewBtnClick, this));
this.statusbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this));
this.statusbar.btnSetSpelling.on('click', _.bind(this.onBtnSpelling, this)); this.statusbar.btnSetSpelling.on('click', _.bind(this.onBtnSpelling, this));
}, },
@ -137,9 +138,26 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.statusbar); Common.NotificationCenter.trigger('edit:complete', this.statusbar);
}, },
onPreview: function(btn, e) { onPreview: function(slidenum, presenter) {
var current = this.api.getCurrentPage(); Common.NotificationCenter.trigger('preview:start', _.isNumber(slidenum) ? slidenum : 0, presenter);
Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0); },
onPreviewBtnClick: function(btn, e) {
this.onPreview(this.api.getCurrentPage());
},
onPreviewItemClick: function(menu, item) {
switch (item.value) {
case 0:
this.onPreview(0);
break;
case 1:
this.onPreview(this.api.getCurrentPage());
break;
case 2:
this.onPreview(0, true);
break;
}
}, },
/* /*

View file

@ -1,7 +1,9 @@
<div class="statusbar" style="display:table;"> <div class="statusbar" style="display:table;">
<div class="status-group">
<div id="slot-status-btn-preview" style="display: inline-block;margin-left: 9px;"></div>
</div>
<div class="status-group dropup"> <div class="status-group dropup">
<button id="status-btn-preview" type="button" class="btn small btn-toolbar" style="margin-left: 9px;"><i class="icon"></i></button>
<label id="status-label-pages" class="status-label dropdown-toggle" style="margin-left: 7px; display: none;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label> <label id="status-label-pages" class="status-label dropdown-toggle" style="margin-left: 7px; display: none;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
<div id="status-goto-box" class="dropdown-menu"> <div id="status-goto-box" class="dropdown-menu">
<label style="float:left;line-height:22px;"><%= scope.goToPageText %></label> <label style="float:left;line-height:22px;"><%= scope.goToPageText %></label>

View file

@ -235,10 +235,22 @@ define([
); );
this.btnPreview = new Common.UI.Button({ this.btnPreview = new Common.UI.Button({
el: $('#status-btn-preview',this.el), cls: 'btn-toolbar',
iconCls: 'btn-preview',
hint: this.tipPreview, hint: this.tipPreview,
hintAnchor: 'top' hintAnchor: 'top',
split: true,
menu: new Common.UI.Menu({
menuAlign: 'bl-tl',
style: 'margin-top:-5px;',
items: [
{caption: this.textShowBegin, value: 0},
{caption: this.textShowCurrent, value: 1},
{caption: this.textShowPresenterView, value: 2}
]
})
}); });
this.btnPreview.render($('#slot-status-btn-preview'));
this.btnDocLanguage = new Common.UI.Button({ this.btnDocLanguage = new Common.UI.Button({
el: $('#btn-doc-lang',this.el), el: $('#btn-doc-lang',this.el),
@ -413,7 +425,10 @@ define([
tipAccessRights : 'Manage document access rights', tipAccessRights : 'Manage document access rights',
tipSetLang : 'Set Text Language', tipSetLang : 'Set Text Language',
tipSetDocLang : 'Set Document Language', tipSetDocLang : 'Set Document Language',
tipSetSpelling : 'Spell checking' tipSetSpelling : 'Spell checking',
textShowBegin: 'Show from Beginning',
textShowCurrent: 'Show from Current slide',
textShowPresenterView: 'Show presenter view'
}, PE.Views.Statusbar || {})); }, PE.Views.Statusbar || {}));
} }
); );

View file

@ -1304,6 +1304,9 @@
"PE.Views.Statusbar.tipZoomIn": "Zoom in", "PE.Views.Statusbar.tipZoomIn": "Zoom in",
"PE.Views.Statusbar.tipZoomOut": "Zoom out", "PE.Views.Statusbar.tipZoomOut": "Zoom out",
"PE.Views.Statusbar.txtPageNumInvalid": "Invalid slide number", "PE.Views.Statusbar.txtPageNumInvalid": "Invalid slide number",
"PE.Views.Statusbar.textShowBegin": "Show from Beginning",
"PE.Views.Statusbar.textShowCurrent": "Show from Current Slide",
"PE.Views.Statusbar.textShowPresenterView": "Show Presenter View",
"PE.Views.TableSettings.deleteColumnText": "Delete Column", "PE.Views.TableSettings.deleteColumnText": "Delete Column",
"PE.Views.TableSettings.deleteRowText": "Delete Row", "PE.Views.TableSettings.deleteRowText": "Delete Row",
"PE.Views.TableSettings.deleteTableText": "Delete Table", "PE.Views.TableSettings.deleteTableText": "Delete Table",

View file

@ -67,10 +67,6 @@
margin-right: 5px; margin-right: 5px;
} }
#status-btn-preview {
.btn-tpl(-160px);
}
.status-group { .status-group {
display: table-cell; display: table-cell;
white-space: nowrap; white-space: nowrap;