Skip to content

Commit

Permalink
WEBUI-1094: Drawer width is hard-coded, not taking value of --nuxeo-s…
Browse files Browse the repository at this point in the history
…idebar-width
  • Loading branch information
rahuljain-dev committed Nov 14, 2024
1 parent 3332eab commit b7dd061
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions elements/nuxeo-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ Polymer({
value: '52px',
},

sidebarWidth: {
type: String,
},

drawerOpened: {
type: Boolean,
value: false,
Expand Down Expand Up @@ -638,7 +642,7 @@ Polymer({

ready() {
this.$.drawerPanel.closeDrawer();

this.drawerWidth = this.sidebarWidth = getComputedStyle(this).getPropertyValue('--nuxeo-sidebar-width');
this.$.drawerPanel.$.drawer.addEventListener('transitionend', () => {
this.$.drawerPanel.notifyResize();
});
Expand Down Expand Up @@ -1001,7 +1005,8 @@ Polymer({
},

_openDrawer() {
this.drawerWidth = '350px';
const pixelsSuffix = 'px';
this.drawerWidth = 298 + Math.round(this.sidebarWidth.substring(0, this.sidebarWidth.length - 2)) + pixelsSuffix;
this.drawerOpened = true;
const { drawerPanel } = this.$;
if (drawerPanel.narrow) {
Expand All @@ -1017,7 +1022,7 @@ Polymer({
},

_closeDrawer() {
this.drawerWidth = '52px';
this.drawerWidth = this.sidebarWidth;
this.drawerOpened = false;
this.$.drawerPanel.closeDrawer();
this.selectedTab = '';
Expand Down

0 comments on commit b7dd061

Please sign in to comment.