@@ -1447,23 +1447,18 @@ function initCore() {
14471447 */
14481448 function setupMainMenu ( ) {
14491449
1450- // init the more-apps menu
1451- OC . registerMenu ( $ ( '#more-apps > a' ) , $ ( '#navigation' ) ) ;
1452-
14531450 // toggle the navigation
1454- var $toggle = $ ( '#header .header-appname-container ' ) ;
1451+ var $toggle = $ ( '#more-apps > a ' ) ;
14551452 var $navigation = $ ( '#navigation' ) ;
14561453 var $appmenu = $ ( '#appmenu' ) ;
14571454
1458- // init the menu
1455+ // init the more-apps menu
14591456 OC . registerMenu ( $toggle , $navigation ) ;
1460- $toggle . data ( 'oldhref' , $toggle . attr ( 'href' ) ) ;
1461- $toggle . attr ( 'href' , '#' ) ;
1462- $navigation . hide ( ) ;
14631457
14641458 // show loading feedback
14651459 $navigation . delegate ( 'a' , 'click' , function ( event ) {
14661460 var $app = $ ( event . target ) ;
1461+
14671462 if ( ! $app . is ( 'a' ) ) {
14681463 $app = $app . closest ( 'a' ) ;
14691464 }
@@ -1486,6 +1481,9 @@ function initCore() {
14861481
14871482 $appmenu . delegate ( 'a' , 'click' , function ( event ) {
14881483 var $app = $ ( event . target ) ;
1484+ if ( $app . parent ( ) . hasClass ( 'menutoggle' ) ) {
1485+ return ;
1486+ }
14891487 if ( ! $app . is ( 'a' ) ) {
14901488 $app = $app . closest ( 'a' ) ;
14911489 }
@@ -1539,27 +1537,6 @@ function initCore() {
15391537 setupUserMenu ( ) ;
15401538 setupContactsMenu ( ) ;
15411539
1542- // move triangle of apps dropdown to align with app name triangle
1543- // 2 is the additional offset between the triangles
1544- if ( $ ( '#navigation' ) . length ) {
1545- $ ( '#header #nextcloud + .menutoggle' ) . on ( 'click' , function ( ) {
1546- $ ( '#menu-css-helper' ) . remove ( ) ;
1547- var caretPosition = $ ( '.header-appname + .icon-caret' ) . offset ( ) . left - 2 ;
1548- if ( caretPosition > 255 ) {
1549- // if the app name is longer than the menu, just put the triangle in the middle
1550- return ;
1551- } else {
1552- $ ( 'head' ) . append ( '<style id="menu-css-helper">#navigation:after { left: ' + caretPosition + 'px; }</style>' ) ;
1553- }
1554- } ) ;
1555- $ ( '#header #appmenu .menutoggle' ) . on ( 'click' , function ( ) {
1556- $ ( '#appmenu' ) . toggleClass ( 'menu-open' ) ;
1557- if ( $ ( '#appmenu' ) . is ( ':visible' ) ) {
1558- $ ( '#menu-css-helper' ) . remove ( ) ;
1559- }
1560- } ) ;
1561- }
1562-
15631540 var resizeMenu = function ( ) {
15641541 var appList = $ ( '#appmenu li' ) ;
15651542 var rightHeaderWidth = $ ( '.header-right' ) . outerWidth ( ) ;
0 commit comments