Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
harelyshau committed Oct 18, 2024
1 parent 6a6a141 commit 1650836
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions controller/BaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ sap.ui.define([
// localStorage

getStorage(sPrefix) {
const sPage = this.getProperty('/page', 'app');
sPrefix ??= `${sPage[0].toLowerCase()}${sPage.slice(1)}`;
const { page } = this.getProperty('/', 'app');
sPrefix ??= `${page[0].toLowerCase()}${page.slice(1)}`;
return new Storage(Storage.Type.local, sPrefix)
},

Expand Down Expand Up @@ -83,8 +83,8 @@ sap.ui.define([
},

addContentDensityClass(oControl) {
const bTouch = this.getProperty('/support/touch', 'device');
oControl.addStyleClass(bTouch ? 'sapUiSizeCozy' : 'sapUiSizeCompact');
const { touch } = this.getProperty('/support', 'device');
oControl.addStyleClass(touch ? 'sapUiSizeCozy' : 'sapUiSizeCompact');
},

setBusy(bBusy) {
Expand Down Expand Up @@ -151,8 +151,8 @@ sap.ui.define([

async loadAndAssignFragment(sFragment) {
const sPrefixFragment = `o${sFragment}`;
const sCurrentPage = this.getProperty('/page', 'app');
const name = `pharelyshau.fragment.${sCurrentPage}.${sFragment}`;
const { page } = this.getProperty('/', 'app');
const name = `pharelyshau.fragment.${page}.${sFragment}`;
this[sPrefixFragment] ??= this.loadFragment({ name });
this[sPrefixFragment] = await this[sPrefixFragment];
this.addContentDensityClass(this[sPrefixFragment]);
Expand All @@ -166,10 +166,10 @@ sap.ui.define([
},

onPressToggleSideNavigation(sModel) {
const bPhone = this.getProperty('/system/phone', 'device');
const sRootPage = this.getProperty('/rootPage', 'app');
const sPage = sRootPage === 'Games' ? sRootPage.slice(0, -1) : sRootPage;
const oPage = this.getElementById(`${bPhone ? 'app' : sPage}--page`);
const { phone } = this.getProperty('/system', 'device');
const { rootPage } = this.getProperty('/', 'app');
const sPage = rootPage === 'Games' ? rootPage.slice(0, -1) : rootPage;
const oPage = this.getElementById(`${phone ? 'app' : sPage}--page`);
const oSideNavigation = this.getElementById(`${sPage}--sideNavigation`);
const bExpanded = this.toggleSideNavigation(oPage, oSideNavigation);
this.setProperty('/sideExpanded', bExpanded, sModel);
Expand Down
4 changes: 2 additions & 2 deletions controller/Calendar.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ sap.ui.define([
},

removeCalendarViews() {
const oDevice = this.getOwnerComponent().getModel('device').getData();
const bSmallScreen = oDevice.system.phone || oDevice.resize.width <= 800;
const { system, resize } = this.getModel('device').getData();
const bSmallScreen = system.phone || resize.width <= 800;
const oCalendar = this.byId('calendar');
(bSmallScreen ? ['week'] : ['two-days', 'three-days'])
.forEach(sKey => oCalendar.removeView(oCalendar.getViewByKey(sKey)));
Expand Down

0 comments on commit 1650836

Please sign in to comment.