소스 검색

[assist] Close table stats when clicking outside the popover

Johan Ahlen 10 년 전
부모
커밋
7a290ed5f8
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      desktop/core/src/desktop/templates/table_stats.mako

+ 6 - 0
desktop/core/src/desktop/templates/table_stats.mako

@@ -166,6 +166,12 @@ from desktop.views import _ko
           }
         });
 
+        $(document).click(function(event) {
+          if(!$(event.target).closest($targetElement).length) {
+            self.analysisStats(null)
+          }
+        })
+
         self.toggleStats = function (data, event) {
           if (self.analysisStats()) {
             self.analysisStats(null);