(e, appName)
| 809 | * @param {string} appName the application to focus |
| 810 | */ |
| 811 | const FocusApp = (e, appName) => { |
| 812 | if (e) |
| 813 | e.stopPropagation(); // stop the event from also being handled by the body |
| 814 | |
| 815 | UnfocusAllApp(); |
| 816 | |
| 817 | let taskbarIcon = document.getElementById("taskbar-"+appName); |
| 818 | taskbarIcon.classList.add("app-active"); |
| 819 | |
| 820 | apps.forEach(app => { |
| 821 | if (app == appName) { |
| 822 | document.getElementById("app-"+appName).style.zIndex = 9999999; |
| 823 | AppsZIndex[app] = 9999999; |
| 824 | } |
| 825 | else { |
| 826 | if (AppsZIndex[app]) { |
| 827 | AppsZIndex[app] -= 1; |
| 828 | } |
| 829 | document.getElementById("app-"+app).style.zIndex = AppsZIndex[app]; |
| 830 | } |
| 831 | }); |
| 832 | |
| 833 | if (appName == "console") { |
| 834 | let consoleInput = document.getElementById("console-input"); |
| 835 | if (consoleInput) consoleInput.focus(); |
| 836 | } |
| 837 | }; |
| 838 | |
| 839 | /** |
| 840 | * Minimizes application |
no test coverage detected