bccu#1749: Fix flashing of spreadsheet-toolbar during doc load

Hide the spreadsheet-toolbar by default, and only show when we
are confirmed that its a spreadsheet, instead of doing
vice-versa.

Change-Id: Iddaca0fb272dbe8dd8b6e73157eb4733762d8a8a
This commit is contained in:
Pranav Kant 2016-04-29 11:22:26 +05:30
parent 0e4c624f0b
commit 742a8da434

View file

@ -113,10 +113,10 @@ $(function () {
$('#spreadsheet-toolbar').w2toolbar({
name: 'spreadsheet-toolbar',
items: [
{ type: 'button', id: 'firstrecord', img: 'firstrecord', hint: _("First Sheet") },
{ type: 'button', id: 'prevrecord', img: 'prevrecord', hint: _("Previous Sheet") },
{ type: 'button', id: 'nextrecord', img: 'nextrecord', hint: _("Next Sheet") },
{ type: 'button', id: 'lastrecord', img: 'lastrecord', hint: _("Last Sheet") }
{ type: 'button', id: 'firstrecord', img: 'firstrecord', hidden: true, hint: _("First Sheet") },
{ type: 'button', id: 'prevrecord', img: 'prevrecord', hidden: true, hint: _("Previous Sheet") },
{ type: 'button', id: 'nextrecord', img: 'nextrecord', hidden: true, hint: _("Next Sheet") },
{ type: 'button', id: 'lastrecord', img: 'lastrecord', hidden: true, hint: _("Last Sheet") }
],
onClick: function (e) {
onClick(e.target);
@ -831,12 +831,12 @@ map.on('updateparts pagenumberchanged', function (e) {
toolbar.hide('incdecindent');
}
var toolbar = w2ui['spreadsheet-toolbar'];
if (e.docType !== 'spreadsheet') {
toolbar.hide('firstrecord');
toolbar.hide('nextrecord');
toolbar.hide('prevrecord');
toolbar.hide('lastrecord');
toolbar = w2ui['spreadsheet-toolbar'];
if (e.docType === 'spreadsheet') {
toolbar.show('firstrecord');
toolbar.show('nextrecord');
toolbar.show('prevrecord');
toolbar.show('lastrecord');
}
});