working on own pictos modal

parent 938efbbd
......@@ -39,28 +39,6 @@ dashboardControllers.controller('AddPictoCtrl', function (
exp: 'Inicio',
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 (
}
$http.get(request)
.success(function (data) {
if (data)
if (data && $scope.source == 'symbolstx'){
$scope.pictos = data;
}
$scope.loadingCatPictos = false;
setTimeout(function () { $scope.$apply(); });
})
......@@ -122,9 +101,12 @@ dashboardControllers.controller('AddPictoCtrl', function (
$http.get(config.backend+'/sup/'+ supervisor.id +'/pic_categories/' + categoryId)
.success(function(data, status, headers, config) {
// Add to list
if (data)
if (data && $scope.source == 'symbolstx'){
$scope.symbolstxCats = data;
else $scope.symbolstxCats = [];
}
else{
$scope.symbolstxCats = [];
}
})
.error(function(data, status, headers, config) {
});
......@@ -379,7 +361,13 @@ dashboardControllers.controller('AddPictoCtrl', function (
}
};
if (onlyOwn)
//Initial load category and pictos
if (onlyOwn){
$scope.load_own_pictos();
}
else {
$scope.load_category(0);
$scope.load_pictos(0);
}
});
......@@ -61,8 +61,8 @@
<input type="text" class="form-control" placeholder="{{ 'filter' | translate }}"
id="srch_term_picto" name="srch_term_picto" ng-model="srch_term_picto">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary">
<i class="fa fa-search" aria-hidden="true"></i> {{ 'search' | translate }}
<button type="submit" class="btn btn-default">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</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