Ver código fonte

HUE-7477 [frontend] Close the left nav on click

Johan Ahlen 8 anos atrás
pai
commit
2597280e01
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      desktop/core/src/desktop/templates/hue.mako

+ 10 - 0
desktop/core/src/desktop/templates/hue.mako

@@ -1258,6 +1258,16 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
         self.leftNavVisible.subscribe(function (val) {
           huePubSub.publish('left.nav.open.toggle', val);
           hueAnalytics.convert('hue', 'leftNavVisible/' + val);
+          if (val) {
+            // Defer or it will be triggered by the open click
+            window.setTimeout(function () {
+              $(document).one('click', function () {
+                if (self.leftNavVisible()) {
+                  self.leftNavVisible(false);
+                }
+              })
+            }, 0);
+          }
         });
 
         self.onePageViewModel.currentApp.subscribe(function () {