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 2020/02/06 07:33:51 UTC
[kylin] 12/12: KYLIN-1716 UI Location Change Bug Fix
This is an automated email from the ASF dual-hosted git repository.
nic pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 1175527722ee817c61571c4cd124cf7a83d61fb8
Author: Sean-Gu <nj...@163.com>
AuthorDate: Wed Nov 27 15:19:50 2019 +0800
KYLIN-1716 UI Location Change Bug Fix
---
webapp/app/js/controllers/query.js | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/webapp/app/js/controllers/query.js b/webapp/app/js/controllers/query.js
index 4301bbf..e2b8520 100644
--- a/webapp/app/js/controllers/query.js
+++ b/webapp/app/js/controllers/query.js
@@ -56,6 +56,8 @@ KylinApp
selectedProject: null
};
+ $scope.locationChangeConfirmed = false;
+
var Query = {
createNew: function (sql, project) {
var query = {
@@ -424,21 +426,23 @@ KylinApp
});
if (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){
- $location.path($location.url(next).hash());
- }
-
- });
+ 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());
+ }
+ });
+ }
}
});