web-apps/apps/documenteditor/mobile/app/controller/phone/Main.js
Maxim Kadushkin 741b10515d webapps added
2016-03-10 21:48:53 -03:00

61 lines
1.9 KiB
JavaScript

Ext.define('DE.controller.phone.Main', {
extend: 'DE.controller.Main',
requires: [
'Ext.Anim'
],
config: {
refs: {
viewToolbar : 'viewtoolbar',
searchToolbar : 'searchtoolbar',
readableBtn : '#id-tb-btn-readable',
searchButton : '#id-tb-btn-search',
incFontSizeButton : '#id-tb-btn-incfontsize',
decFontSizeButton : '#id-tb-btn-decfontsize',
shareButton : '#id-tb-btn-view-share'
}
},
launch: function() {
this.callParent(arguments);
},
initControl: function() {
this.callParent(arguments);
},
initApi: function() {
this.callParent(arguments);
},
setApi: function(o){
this.api = o;
var viewToolbar = this.getViewToolbar();
viewToolbar && viewToolbar.show();
this.api && this.api.asc_enableKeyEvents(false);
},
setReadableMode: function(readable) {
var readableBtn = this.getReadableBtn(),
searchButton = this.getSearchButton(),
incFontSizeButton = this.getIncFontSizeButton(),
decFontSizeButton = this.getDecFontSizeButton(),
shareButton = this.getShareButton();
if (readable) {
readableBtn && readableBtn.show();
searchButton && searchButton.hide();
incFontSizeButton && incFontSizeButton.show();
decFontSizeButton && decFontSizeButton.show();
shareButton && shareButton.hide();
} else {
readableBtn && readableBtn.hide();
searchButton && searchButton.show();
incFontSizeButton && incFontSizeButton.hide();
decFontSizeButton && decFontSizeButton.hide();
shareButton && shareButton.show();
}
}
});