Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Commit 6e1016d

Browse files
author
jj
committed
Fix Modal closing bug
1 parent cf0a717 commit 6e1016d

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed

src/main/webapp/js/workbench/extraction-and-loading/d2rq-mapping-controller.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ var D2RQMappingCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Ac
133133
headers: {"Content-Type":"application/json; charset=utf-8"}
134134
}).then(function(response) {
135135
$scope.refreshMappingGroups().then(function(response) {
136-
close('#modalMappingGroup');
136+
$scope.close('#modalMappingGroup');
137137
adding = false;
138138
});
139139
}, function(response) {
140-
close('#modalMappingGroup');
140+
$scope.close('#modalMappingGroup');
141141
flash.error = ServerErrorResponse.getMessage(response.status);
142142
});
143143
});
@@ -694,11 +694,11 @@ var D2RQMappingCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Ac
694694
headers: {"Content-Type":"application/json; charset=utf-8"}
695695
}).then(function(response) {
696696
$scope.refreshMappingGroups().then(function(response) {
697-
close('#modalMapping');
697+
$scope.close('#modalMapping');
698698
adding = false;
699699
});
700700
}, function(response) {
701-
close('#modalMapping');
701+
$scope.close('#modalMapping');
702702
flash.error = ServerErrorResponse.getMessage(response.status);
703703
});
704704
});
@@ -711,11 +711,11 @@ var D2RQMappingCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Ac
711711
headers: {"Content-Type":"application/json; charset=utf-8"}
712712
}).then(function(response) {
713713
$scope.refreshMappingGroups().then(function(response) {
714-
close('#modalMapping');
714+
$scope.close('#modalMapping');
715715
adding = false;
716716
});
717717
}, function(response) {
718-
close('#modalMapping');
718+
$scope.close('#modalMapping');
719719
flash.error = ServerErrorResponse.getMessage(response.status);
720720
});
721721
}
@@ -738,4 +738,12 @@ var D2RQMappingCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Ac
738738
$scope.localize = function(str) {
739739
return localize.getLocalizedString(str);
740740
};
741+
742+
$scope.close = function(modalID) {
743+
$(modalID).modal('hide');
744+
$('body').removeClass('modal-open');
745+
$('.modal-backdrop').slideUp();
746+
$('.modal-scrollable').slideUp();
747+
};
748+
741749
};

src/main/webapp/js/workbench/extraction-and-loading/d2rq-task-controller.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,20 @@ var D2RQTaskCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Accou
6565
};
6666

6767
var findDataset = function(ontology, endpoint, graph) {
68+
console.log($scope.datasets);
6869
for (var ind in $scope.datasets) {
6970
var ds = $scope.datasets[ind];
7071
if (ds.graph==graph && ds.httpEndpoint==endpoint && ds.ontology==ontology)
72+
console.log(ds);
7173
return ds;
7274
}
7375
return null;
7476
};
7577

7678
var findOrCreateDataset = function(ontology, endpoint, graph) {
79+
console.log(ontology + " " + endpoint + " " + graph);
7780
var ds = findDataset(ontology, endpoint, graph);
81+
console.log(ds);
7882
if (ds!=null) {
7983
var deferred = $q.defer();
8084
deferred.resolve(ds);
@@ -105,12 +109,12 @@ var D2RQTaskCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Accou
105109
headers: {"Content-Type":"application/json; charset=utf-8"}
106110
}).then(function(response) {
107111
$scope.refreshTasks().then(function(response) {
108-
close('#modalTask');
112+
$scope.close('#modalTask');
109113
adding = false;
110114
});
111115
}, function(response) {
112116
flash.error = ServerErrorResponse.getMessage(response.status);
113-
close('#modalTask');
117+
$scope.close('#modalTask');
114118
});
115119
});
116120
};
@@ -147,4 +151,12 @@ var D2RQTaskCtrl = function($scope, $http, $q, flash, ServerErrorResponse, Accou
147151
$scope.refreshTasks();
148152
});
149153
};
154+
155+
$scope.close = function(modalID) {
156+
$(modalID).modal('hide');
157+
$('body').removeClass('modal-open');
158+
$('.modal-backdrop').slideUp();
159+
$('.modal-scrollable').slideUp();
160+
};
161+
150162
};

src/main/webapp/js/workbench/manual-revision-and-authoring/ontology-controller.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var OntologyCtrl = function($scope, $http, flash, ServerErrorResponse, AccountSe
5757
headers: {"Content-Type":"application/json; charset=utf-8"}
5858
}).then(function(response) {
5959
$scope.refreshOntologies();
60-
close('#modalOntology');
60+
$scope.close('#modalOntology');
6161
}, function(response) {
6262
flash.error = ServerErrorResponse.getMessage(response.status);
6363
$scope.refreshOntologies();
@@ -69,7 +69,7 @@ var OntologyCtrl = function($scope, $http, flash, ServerErrorResponse, AccountSe
6969
data: {user: AccountService.getUsername()} //todo unauthorized user
7070
}).then(function(response) {
7171
$scope.refreshOntologies();
72-
close('#modalOntology');
72+
$scope.close('#modalOntology');
7373
}, function(response) {
7474
flash.error = ServerErrorResponse.getMessage(response.status);
7575
$scope.refreshOntologies();
@@ -119,4 +119,12 @@ var OntologyCtrl = function($scope, $http, flash, ServerErrorResponse, AccountSe
119119
$scope.isLoggedIn = function() {
120120
return AccountService.isLogged();
121121
};
122+
123+
$scope.close = function(modalID) {
124+
$(modalID).modal('hide');
125+
$('body').removeClass('modal-open');
126+
$('.modal-backdrop').slideUp();
127+
$('.modal-scrollable').slideUp();
128+
};
129+
122130
};

0 commit comments

Comments
 (0)