-
Notifications
You must be signed in to change notification settings - Fork 0
/
Component.js
1 lines (1 loc) · 1.89 KB
/
Component.js
1
sap.ui.define(["sap/ui/core/UIComponent","sap/ui/Device","ugiaiwui/mdg/aiw/request/model/models","ugiaiwui/mdg/aiw/request/controller/ErrorHandler","sap/ui/core/routing/HashChanger"],function(e,t,i,s,n){"use strict";return e.extend("ugiaiwui.mdg.aiw.request.Component",{metadata:{manifest:"json"},init:function(){e.prototype.init.apply(this,arguments);this._oErrorHandler=new s(this);this.setModel(i.createDeviceModel(),"device");this.setModel(i.createFLPModel(),"FLP");var t=new sap.ui.model.json.JSONModel({init:false});this.setModel(t,"mainModel");this.getRouter().initialize();var o=n.getInstance();if(this.getComponentData().startupParameters.hasOwnProperty("mode")){var r=this.getComponentData().startupParameters.mode[0];if(r!==null&&r==="display"){o.replaceHash("request");var a=this;this.getService("ShellUIService").then(function(e){var t=a.getModel("i18n").getResourceBundle().getText("title");e.setTitle(t)},function(e){jQuery.sap.log.error("Cannot get ShellUIService",e,"Title")})}else{o.replaceHash("main");var a=this;this.getService("ShellUIService").then(function(e){var t=a.getModel("i18n").getResourceBundle().getText("title");e.setTitle(t)},function(e){jQuery.sap.log.error("Cannot get ShellUIService",e,"Title")})}}else{o.replaceHash("main");var a=this;this.getService("ShellUIService").then(function(e){var t=a.getModel("i18n").getResourceBundle().getText("title");e.setTitle(t)},function(e){jQuery.sap.log.error("Cannot get ShellUIService",e,"Title")})}},destroy:function(){this._oErrorHandler.destroy();e.prototype.destroy.apply(this,arguments)},getContentDensityClass:function(){if(this._sContentDensityClass===undefined){if(jQuery(document.body).hasClass("sapUiSizeCozy")||jQuery(document.body).hasClass("sapUiSizeCompact")){this._sContentDensityClass=""}else if(!t.support.touch){this._sContentDensityClass="sapUiSizeCompact"}else{this._sContentDensityClass="sapUiSizeCozy"}}return this._sContentDensityClass}})});