Browse Source

Ensure that main menu toolbar comes first, and that other buttons come before metamodels.

bentleyjoakes 5 years ago
parent
commit
9f3f98944f
1 changed files with 12 additions and 0 deletions
  1. 12 0
      client/gui_utils.js

+ 12 - 0
client/gui_utils.js

@@ -667,6 +667,9 @@ GUIUtils = function(){
 			if (a.id.includes("MainMenu")) {
 			if (a.id.includes("MainMenu")) {
 				return -1;
 				return -1;
 			}
 			}
+			if (b.id.includes("MainMenu")) {
+				return 1;
+			}
 
 
 			//toolbars come first
 			//toolbars come first
 			if (a.id.includes("Toolbars") && !(b.id.includes("Toolbars"))) {
 			if (a.id.includes("Toolbars") && !(b.id.includes("Toolbars"))) {
@@ -677,6 +680,15 @@ GUIUtils = function(){
 				return 1;
 				return 1;
 			}
 			}
 
 
+			//any other kind of buttons come next
+			if (a.id.includes(".buttons.model") && !(b.id.includes(".buttons.model"))) {
+				return -1;
+			}
+
+			if (b.id.includes(".buttons.model") && !(a.id.includes(".buttons.model"))) {
+				return 1;
+			}
+
 			//otherwise, sort by name
 			//otherwise, sort by name
 			return a.id == b.id ? 0 : (a.id > b.id ? 1 : -1);
 			return a.id == b.id ? 0 : (a.id > b.id ? 1 : -1);
 		});
 		});