From ef0405b021a6a638fa49a004eb35c38b4304a2ec Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 21 Sep 2016 17:39:38 +0200 Subject: [PATCH] * Mobile template: Close sidemenu after clicking on items in sidebar --- api/js/etemplate/et2_widget_tree.js | 2 ++ pixelegg/js/fw_mobile.js | 1 + 2 files changed, 3 insertions(+) diff --git a/api/js/etemplate/et2_widget_tree.js b/api/js/etemplate/et2_widget_tree.js index f676b65b4f..2d73660bad 100644 --- a/api/js/etemplate/et2_widget_tree.js +++ b/api/js/etemplate/et2_widget_tree.js @@ -278,6 +278,8 @@ var et2_tree = (function(){ "use strict"; return et2_inputWidget.extend( var args = jQuery.makeArray(arguments); // splice in widget as 2. parameter, 1. is new node-id, now 3. is old node id args.splice(1, 0, widget); + // try to close mobile sidemenu after clicking on node + if (egwIsMobile() && typeof args[2] == 'string') framework.toggleMenu('on'); return handler.apply(this, args); }); } diff --git a/pixelegg/js/fw_mobile.js b/pixelegg/js/fw_mobile.js index 8fa428e9fe..b3aa6aef09 100644 --- a/pixelegg/js/fw_mobile.js +++ b/pixelegg/js/fw_mobile.js @@ -46,6 +46,7 @@ open: function() { this._super.apply(this,arguments); + jQuery('.egw_fw_ui_sidemenu_listitem', this.contentDiv).click(function(){framework.toggleMenu('on');}); framework.toggleMenu('on'); } });