Jelajahi Sumber

Ticket #4279 - Artificer: bad notifications in offcanvas menu on mobile.

AntonLV 3 tahun lalu
induk
melakukan
52f3cbc66f

+ 5 - 0
modules/boonex/artificer/data/template/system/scripts/BxTemplMenuAccountNotifications.php

@@ -29,6 +29,11 @@ class BxTemplMenuAccountNotifications extends BxBaseMenuAccountNotifications
                 if(isset($a['onclick']))
                     $a['onclick'] = str_replace(['bx_menu_slide_inline', 'bx-menu-toolbar-item-add-content'], ['oBxArtificerUtils.getAddContentMenu', 'bx-menu-toolbar-item-account'], $a['onclick']);
                 break;
+
+            case 'notifications-notifications':
+                if(isset($a['onclick']))
+                    $a['onclick'] = str_replace(['bx_menu_slide', 'this'], ['oBxArtificerUtils.getNotificationsMenu', '$(\'#bx-menu-toolbar-item-account a\').get(0)'], $a['onclick']);
+                break;
         }
 
         return $a;

+ 12 - 0
modules/boonex/artificer/js/utils.js

@@ -94,4 +94,16 @@ BxArtificerUtils.prototype.getAddContentMenu = function(sMenu, e, sPosition) {
         bx_sidebar_toggle(sSidebar);
 
     bx_menu_popup_inline(sMenu, e, {});
+};
+
+BxArtificerUtils.prototype.getNotificationsMenu = function(sMenu, e, sPosition, oOptions) {
+    $('.bx-popup-applied:visible').dolPopupHide();
+
+    var sSidebar = 'account';
+    if(bx_sidebar_active(sSidebar))
+        bx_sidebar_toggle(sSidebar);
+
+    oOptions = $.extend({}, {pointer: {align:'right'}, cssClass: ''}, oOptions);
+
+    bx_menu_popup(sMenu, e, oOptions);
 };