Skip to content

Commit

Permalink
fix(app-shell): small fix to works fine the resizable (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicalcantFrontEnd authored May 22, 2024
1 parent a3fd091 commit ae0f78a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions libs/components/src/app-shell/app-shell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@
}

&:hover::after,
&.resizing::after {
&.helpResizable::after {
opacity: 1;
}
}

:host([resizing]) .resize-handle {
:host([helpResizable]) .resize-handle {
display: block;
}

:host(:not([resizing])) .resize-handle {
:host(:not([helpResizable])) .resize-handle {
display: none;
}

Expand Down
12 changes: 6 additions & 6 deletions libs/components/src/app-shell/app-shell.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
args: {
contained: true,
fullWidth: false,
resizing: true,
helpResizable: true,
},
argTypes: {
navClick: { action: 'clicked' },
Expand Down Expand Up @@ -54,7 +54,7 @@ const Template = ({
forcedOpen = false,
contained = true,
fullWidth = false,
resizing = true,
helpResizable = true,
}) => {
document.addEventListener(
'DOMContentLoaded',
Expand Down Expand Up @@ -104,7 +104,7 @@ const Template = ({
${forcedOpen ? `forcedOpen open` : ''}
${contained ? `contained` : ''}
${fullWidth ? `fullWidth` : ''}
${resizing ? `resizing` : ''}
${helpResizable ? `helpResizable` : ''}
>
Expand Down Expand Up @@ -317,7 +317,7 @@ fullWidth.args = {
fullWidth: true,
};

export const resizing = Template.bind({});
resizing.args = {
resizing: true,
export const helpResizable = Template.bind({});
helpResizable.args = {
helpResizable: true,
};
4 changes: 2 additions & 2 deletions libs/components/src/app-shell/app-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class CovalentAppShell extends DrawerBase {
this._startWidth = this.helpWidth;
document.addEventListener('mousemove', this._resize);
document.addEventListener('mouseup', this._stopResize);
(event.target as HTMLElement).classList.add('resizing');
(event.target as HTMLElement).classList.add('helpResizable');
}

resizeHandle?.addEventListener('dblclick', () => {
Expand Down Expand Up @@ -191,7 +191,7 @@ export class CovalentAppShell extends DrawerBase {
document.removeEventListener('mouseup', this._stopResize);
const resizeHandle = this.shadowRoot?.querySelector('.resize-handle');
if (resizeHandle) {
resizeHandle.classList.remove('resizing');
resizeHandle.classList.remove('helpResizable');
}
}

Expand Down

0 comments on commit ae0f78a

Please sign in to comment.