Skip to content

Commit

Permalink
Piccoli miglioramenti javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrycz committed Apr 16, 2019
1 parent 2eb547b commit 5e2f043
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
13 changes: 8 additions & 5 deletions src/main/webapp/app/components/cnrtree/cnrtree.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
};

$scope.$watch("filter", function(newVal, oldVal, scope) {
if (newVal === '') {
$scope.treeInstance.jstree(true).clear_search ();
$scope.treeInstance.jstree(true).close_all();
} else
$scope.treeInstance.jstree(true).search(newVal, true, true);
if ($scope.treeInstance) {
if (newVal === '') {
$scope.treeInstance.jstree(true).clear_search ();
$scope.treeInstance.jstree(true).close_all();
} else {
$scope.treeInstance.jstree(true).search(newVal, true, true);
}
}
})

$scope.jsonlist = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
resolve: {
variables: function() {
//escludo le variabili di tipo "_json"
return variables.filter(variable => !variable.name.includes("_json"));
return variables.filter(function(variable) { return !variable.name.includes("_json");});
},
title: function() {
return title;
Expand Down
9 changes: 5 additions & 4 deletions src/main/webapp/app/pages/search/search.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function() {
"use strict";
'use strict';

angular.module("sprintApp").controller("SearchController", SearchController);

Expand Down Expand Up @@ -32,9 +32,10 @@
$location.search(vm.searchParams);

//ripulisco i valori con null(tipo quando annullo la data selezionata)
Object.keys(vm.searchParams).forEach(
key => vm.searchParams[key] == null && delete vm.searchParams[key]
);
Object.keys(vm.searchParams).forEach(function(key) {
if(vm.searchParams[key] == null)
delete vm.searchParams[key];
});
dataService.processInstances.search(vm.searchParams).then(
function(response) {
vm.results = utils.refactoringVariables(response.data.data);
Expand Down

0 comments on commit 5e2f043

Please sign in to comment.