| 101 | |
| 102 | // Remove About pgAdmin 4 from help menu and add it to the top of menuFile submenu. |
| 103 | function moveAboutMenuToTop(pgadminMenus, menuFile) { |
| 104 | const helpMenu = pgadminMenus.find((menu) => menu.name == 'help'); |
| 105 | if (!helpMenu) return; |
| 106 | const aboutItem = helpMenu.submenu.find((item) => item.name === 'mnu_about'); |
| 107 | if (!aboutItem) return; |
| 108 | helpMenu.submenu = helpMenu.submenu.filter((item) => item.name !== 'mnu_about'); |
| 109 | menuFile.submenu.unshift(aboutItem); |
| 110 | menuFile.submenu.splice(2, 0, { type: 'separator' }); |
| 111 | } |
| 112 | |
| 113 | // Builds the application menu template and binds menu click events. |
| 114 | // Handles platform-specific menu structure and dynamic menu items. |