working on own pictos modal

parent 938efbbd
...@@ -39,28 +39,6 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -39,28 +39,6 @@ dashboardControllers.controller('AddPictoCtrl', function (
exp: 'Inicio', exp: 'Inicio',
glyphicon: 'glyphicon glyphicon-home' glyphicon: 'glyphicon glyphicon-home'
}); });
// Request of general pictos categories (symbolstx)
$http.get(config.backend + '/sup/' + supervisor.id + '/pic_categories/0')
.success(function (data) {
$scope.symbolstxCats = data;
})
.error(function () {
$translate('error_loading_pictos').then(function (translation) {
ngToast.danger({ content: translation });
});
});
// Request page 1 pictos (symbolstx)
$http.get(config.backend + '/sup/' + supervisor.id + '/pic_fromSymbolStx/page/1/limit/'+$scope.limit)
.success(function (data) {
$scope.pictos = data;
})
.error(function () {
$translate('error_loading_pictos').then(function (translation) {
ngToast.danger({ content: translation });
});
});
} }
// //
...@@ -80,8 +58,9 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -80,8 +58,9 @@ dashboardControllers.controller('AddPictoCtrl', function (
} }
$http.get(request) $http.get(request)
.success(function (data) { .success(function (data) {
if (data) if (data && $scope.source == 'symbolstx'){
$scope.pictos = data; $scope.pictos = data;
}
$scope.loadingCatPictos = false; $scope.loadingCatPictos = false;
setTimeout(function () { $scope.$apply(); }); setTimeout(function () { $scope.$apply(); });
}) })
...@@ -122,9 +101,12 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -122,9 +101,12 @@ dashboardControllers.controller('AddPictoCtrl', function (
$http.get(config.backend+'/sup/'+ supervisor.id +'/pic_categories/' + categoryId) $http.get(config.backend+'/sup/'+ supervisor.id +'/pic_categories/' + categoryId)
.success(function(data, status, headers, config) { .success(function(data, status, headers, config) {
// Add to list // Add to list
if (data) if (data && $scope.source == 'symbolstx'){
$scope.symbolstxCats = data; $scope.symbolstxCats = data;
else $scope.symbolstxCats = []; }
else{
$scope.symbolstxCats = [];
}
}) })
.error(function(data, status, headers, config) { .error(function(data, status, headers, config) {
}); });
...@@ -379,7 +361,13 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -379,7 +361,13 @@ dashboardControllers.controller('AddPictoCtrl', function (
} }
}; };
if (onlyOwn) //Initial load category and pictos
if (onlyOwn){
$scope.load_own_pictos(); $scope.load_own_pictos();
}
else {
$scope.load_category(0);
$scope.load_pictos(0);
}
}); });
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
<input type="text" class="form-control" placeholder="{{ 'filter' | translate }}" <input type="text" class="form-control" placeholder="{{ 'filter' | translate }}"
id="srch_term_picto" name="srch_term_picto" ng-model="srch_term_picto"> id="srch_term_picto" name="srch_term_picto" ng-model="srch_term_picto">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-default">
<i class="fa fa-search" aria-hidden="true"></i> {{ 'search' | translate }} <i class="fa fa-search" aria-hidden="true"></i>
</button> </button>
</span> </span>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment