Commit a3c44826 by Jose Antonio

Reset pictos when there is no word in text field

parent ea291d85
...@@ -316,9 +316,16 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -316,9 +316,16 @@ dashboardControllers.controller('AddPictoCtrl', function (
$scope.search = function() { $scope.search = function() {
$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 == 1){ //Check the word length
$scope.alert = { type: 'warning', msg: 'warning_two_characters', show: true }; $scope.alert = { type: 'warning', msg: 'warning_two_characters', show: true };
}else if(length == 0){ // If there is no word, reset pictos
if ($scope.onlyOwn || $scope.source == "ownpictos"){
$scope.load_own_pictos();
}else{
$scope.open_category_from_bc(0);
}
}else{ }else{
var request = ""; var request = "";
var source = 1; var source = 1;
......
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