Skip to content

Commit 44bc77e

Browse files
authored
Merge pull request #352 from CorbinWunderlich/start-menu-change-direction
Make the float menu list and window list open up or down depending on position
2 parents 4343ad0 + 1685792 commit 44bc77e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

html5/js/MenuCustom.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,33 @@ $(function () {
138138
client.mouse_grabbed = false;
139139
client.toolbar_position = "custom";
140140
client.reconfigure_all_trays();
141+
142+
if (float_menu.children(".Menu").hasClass("-vertical")) {
143+
return;
144+
}
145+
146+
// If the float menu is in the upper half of the screen, the menu_list and open_windows_list will open downwards, and vice versa.
147+
const float_menu_top_css = float_menu.css("top")
148+
const float_menu_top = float_menu_top_css.substring(0, float_menu_top_css.length - 2);
149+
150+
if (Number(float_menu_top) > client.desktop_height / 2) {
151+
$("#menu_list").css("bottom", "30px");
152+
$("#open_windows_list").css({
153+
"bottom": "30px",
154+
"border-top-left-radius": "3px",
155+
"border-top-right-radius": "3px",
156+
"border-bottom-left-radius": "0px",
157+
"border-bottom-right-radius": "0px"
158+
});
159+
} else {
160+
$("#menu_list").css("bottom", "unset");
161+
$("#open_windows_list").css({
162+
"bottom": "unset",
163+
"border-top-left-radius": "0px",
164+
"border-top-right-radius": "0px",
165+
"border-bottom-left-radius": "3px",
166+
"border-bottom-right-radius": "3px"
167+
});
168+
}
141169
});
142170
});

0 commit comments

Comments
 (0)