Skip to content

Commit ebd2d64

Browse files
devvaannshabose
authored andcommitted
fix: remove redundant JS for button visibility and replaced with css
1 parent 4e1e21c commit ebd2d64

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

src/extensionsIntegrated/CollapseFolders/main.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,7 @@ define(function (require, exports, module) {
7171
`);
7272

7373
$collapseBtn.on("click", handleCollapseBtnClick);
74-
7574
$projectFilesHeader.append($collapseBtn); // append the btn to the project-files-header
76-
77-
_setupHoverBehavior($collapseBtn); // hover functionality to show/hide the button
78-
}
79-
80-
/**
81-
* This function is responsible for the hover behavior to show/hide the collapse button
82-
* we only show the button when the cursor is over the sidebar area
83-
*/
84-
function _setupHoverBehavior($collapseBtn) {
85-
const $sidebar = $("#sidebar");
86-
if ($sidebar.length === 0) {
87-
return;
88-
}
89-
90-
// we need this check to see if on site load the mouse is already over the sidebar area or not
91-
// because if it is, then we need to show the button
92-
if ($sidebar.is(":hover")) {
93-
$collapseBtn.addClass("show");
94-
}
95-
96-
$sidebar.on("mouseenter", function () {
97-
$collapseBtn.addClass("show");
98-
});
99-
100-
$sidebar.on("mouseleave", function () {
101-
$collapseBtn.removeClass("show");
102-
});
10375
}
10476

10577
AppInit.appReady(function () {

src/styles/Extn-CollapseFolders.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
font-size: 0.5em;
1818
line-height: 1;
1919
}
20+
}
2021

21-
&.show {
22-
opacity: 1;
23-
visibility: visible;
24-
}
22+
#sidebar:hover #collapse-folders {
23+
opacity: 1;
24+
visibility: visible;
2525
}

0 commit comments

Comments
 (0)