Просмотр исходного кода

#3211 Decorous: most of menus aren't working in mobile app

Alex Trofimov 5 лет назад
Родитель
Сommit
f3236b21bc
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      modules/boonex/decorous/template/js/custom.js

+ 6 - 6
modules/boonex/decorous/template/js/custom.js

@@ -4,10 +4,10 @@ function bx_menu_slide_inline_custom (sMenu, e, sPosition) {
 	
 	if ('undefined' == typeof(e))
         e = eSlider.data('data-control-btn');
-	
-    var eIcon = $(e).find('.sys-icon-a');    
 
-	var iRight = $(document).width() - $(e).offset().left - $(e).width();
+    var eIcon = !e ? null : $(e).find('.sys-icon-a');    
+
+	var iRight = !e ? 0 : $(document).width() - $(e).offset().left - $(e).width();
 	if ('#bx-sliding-menu-search' == sMenu)
 		iRight = 0;
 
@@ -39,13 +39,13 @@ function bx_menu_slide_inline_custom (sMenu, e, sPosition) {
     };
 
     var fClose = function () {
-        if (eIcon.length)
+        if (eIcon && eIcon.length)
             (new Marka(eIcon[0])).set(eIcon.attr('data-icon-orig'));
         eSlider.slideUp()
     };
 
     var fOpen = function () {
-        if (eIcon.length) {
+        if (eIcon && eIcon.length) {
             eIcon.attr('data-icon-orig', eIcon.attr('data-icon'));
             (new Marka(eIcon[0])).set('times');
         }
@@ -138,4 +138,4 @@ function bx_menu_main_click (obj) {
 	}
 	$(obj).parents('li.has-submenu:first').toggleClass('submenu-closed');
 	
-}
+}