You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2019/12/04 03:40:46 UTC

[kylin] branch master updated: fix location change url error

This is an automated email from the ASF dual-hosted git repository.

nic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 0a2786e  fix location change url error
0a2786e is described below

commit 0a2786e5a126d1867ff24a2c44cd90af12487563
Author: Sean-Gu <nj...@163.com>
AuthorDate: Thu Nov 28 14:25:07 2019 +0800

    fix location change url error
---
 webapp/app/js/controllers/query.js | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/webapp/app/js/controllers/query.js b/webapp/app/js/controllers/query.js
index e2b8520..e0a92ae 100644
--- a/webapp/app/js/controllers/query.js
+++ b/webapp/app/js/controllers/query.js
@@ -419,30 +419,29 @@ KylinApp
 
         $scope.$on('$locationChangeStart', function (event, next, current) {
             var isExecuting = false;
+            var nextURL = $location.path();
             angular.forEach($scope.queries, function (query, index) {
                 if (query.status == "executing") {
                     isExecuting = true;
                 }
             });
 
-            if (isExecuting && (next.replace(current, "").indexOf("#") != 0)) {
-                if (!$scope.locationChangeConfirmed) {
-                    event.preventDefault();
-                    SweetAlert.swal({
-                      title: '',
-                      text: "You've executing query in current page, are you sure to leave this page?",
-                      type: '',
-                      showCancelButton: true,
-                      confirmButtonColor: '#DD6B55',
-                      confirmButtonText: "Yes",
-                      closeOnConfirm: true
-                    }, function(isConfirm) {
-                        if(isConfirm){
-                          $scope.locationChangeConfirmed = true;
-                          $location.path($location.url(next).hash());
-                        }
-                    });
-                }
+            if (!$scope.locationChangeConfirmed && isExecuting && (next.replace(current, "").indexOf("#") != 0)) {
+                event.preventDefault();
+                SweetAlert.swal({
+                  title: '',
+                  text: "You've executing query in current page, are you sure to leave this page?",
+                  type: '',
+                  showCancelButton: true,
+                  confirmButtonColor: '#DD6B55',
+                  confirmButtonText: "Yes",
+                  closeOnConfirm: true
+                }, function(isConfirm) {
+                    if(isConfirm){
+                      $scope.locationChangeConfirmed = true;
+                      $location.path(nextURL);
+                    }
+                });
             }
         });