onlyOwn search enabled

parent c0558c4d
...@@ -315,9 +315,6 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -315,9 +315,6 @@ dashboardControllers.controller('AddPictoCtrl', function (
// //
$scope.search = function() { $scope.search = function() {
if ($scope.onlyOwn)
return;
$scope.page=1; // Reset pagination $scope.page=1; // Reset pagination
var length = $scope.srch_term_picto == undefined ? 0 : $scope.srch_term_picto.length; var length = $scope.srch_term_picto == undefined ? 0 : $scope.srch_term_picto.length;
if(length <2){ //Check the word length if(length <2){ //Check the word length
...@@ -327,11 +324,16 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -327,11 +324,16 @@ dashboardControllers.controller('AddPictoCtrl', function (
var source = 1; var source = 1;
$scope.closeAlert(); $scope.closeAlert();
$scope.loadingCatPictos = true; $scope.loadingCatPictos = true;
//category to look in //category to look in
var category = $scope.breadcrumbs[$scope.breadcrumbs.length-1].id; var category;
if (!$scope.onlyOwn){
category = $scope.breadcrumbs[$scope.breadcrumbs.length-1].id;
if(category == 999){ if(category == 999){
category = $scope.breadcrumbs[$scope.breadcrumbs.length-2].id category = $scope.breadcrumbs[$scope.breadcrumbs.length-2].id
} }
}
if($scope.source == "ownpictos"){ if($scope.source == "ownpictos"){
source = 2; source = 2;
category = 0; category = 0;
...@@ -339,7 +341,9 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -339,7 +341,9 @@ dashboardControllers.controller('AddPictoCtrl', function (
request = config.backend + '/sup/' + supervisor.id + request = config.backend + '/sup/' + supervisor.id +
'/pic_fromSearch/'+$scope.srch_term_picto+'/category/'+category+ '/pic_fromSearch/'+$scope.srch_term_picto+'/category/'+category+
'/source/'+source; '/source/'+source;
// Add Search to breadcrumbs // Add Search to breadcrumbs
if (!$scope.onlyOwn){
if($scope.breadcrumbs[$scope.breadcrumbs.length-1].id != 999){ if($scope.breadcrumbs[$scope.breadcrumbs.length-1].id != 999){
$scope.breadcrumbs.push({ $scope.breadcrumbs.push({
id: 999, id: 999,
...@@ -347,6 +351,7 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -347,6 +351,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
glyphicon: 'glyphicon glyphicon-chevron-right' glyphicon: 'glyphicon glyphicon-chevron-right'
}); });
} }
}
$scope.symbolstxCats = []; $scope.symbolstxCats = [];
......
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