Skip to content

Commit

Permalink
bump build 3.0.1 (temporary branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmccabe committed Jul 20, 2016
1 parent 2bfc138 commit 4e536e6
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-advanced-searchbox",
"version": "3.0.0",
"version": "3.0.1",
"homepage": "https://github.com/dnauck/angular-advanced-searchbox",
"authors": [
"Daniel Nauck <d.nauck@nauck-it.de>"
Expand Down
17 changes: 16 additions & 1 deletion dist/angular-advanced-searchbox-tpls.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ angular.module('angular-advanced-searchbox', [])
return $filter('filter')($scope.searchParams, function (param) { return param.key === value.key && !param.allowMultiple; }).length === 0;
};

$scope.canAddParameter = function () {
var availableParameters = $scope.parameters.length;
for (var i = 0; i < $scope.parameters.length; i++) {
if (!$scope.parameters[i].allowMultiple) {
for ( var j = 0; j < $scope.searchParams.length; j++) {
if ($scope.parameters[i].key === $scope.searchParams[j].key) {
availableParameters -= 1;
break;
}
}
}
}
return availableParameters > 0;
};

$scope.addSearchParam = function (searchParam, value, enterEditModel) {
if (enterEditModel === undefined)
enterEditModel = true;
Expand Down Expand Up @@ -444,7 +459,7 @@ angular.module('angular-advanced-searchbox').run(['$templateCache', function($te
'use strict';

$templateCache.put('angular-advanced-searchbox.html',
"<div class=advancedSearchBox ng-class={active:focus} ng-init=\"focus = false\" ng-click=\"!focus ? setFocusFor('searchbox') : null\"><span ng-show=\"searchParams.length < 1 && searchQuery.length === 0\" class=\"search-icon glyphicon glyphicon-search\"></span> <a ng-href=\"\" ng-show=\"searchParams.length > 0 || searchQuery.length > 0\" ng-click=removeAll() role=button><span class=\"remove-all-icon glyphicon glyphicon-trash\"></span></a><div><div class=search-parameter ng-repeat=\"searchParam in searchParams\"><a ng-href=\"\" ng-click=removeSearchParam($index) role=button><span class=\"remove glyphicon glyphicon-trash\"></span></a><div class=key data-key={{searchParam.key}} ng-click=\"enterEditMode($event, $index)\">{{searchParam.name}}:</div><div class=value><span ng-show=!searchParam.editMode ng-click=\"enterEditMode($event, $index)\">{{searchParam.value}}</span> <input name=value type={{searchParam.type}} nit-auto-size-input set-focus-on=\"{{'searchParam:' + searchParam.key}}\" ng-keydown=\"keydown($event, $index)\" ng-blur=\"leaveEditMode($event, $index)\" ng-show=searchParam.editMode ng-change=\"searchParam.restrictToSuggestedValues !== true ? searchParamValueChanged(searchParam) : null\" ng-model=searchParam.value uib-typeahead=\"suggestedValue for suggestedValue in searchParam.suggestedValues | filter:$viewValue\" typeahead-min-length=0 typeahead-on-select=\"searchParamTypeaheadOnSelect($item, searchParam)\" typeahead-editable=\"searchParam.restrictToSuggestedValues !== true\" typeahead-select-on-exact=true typeahead-select-on-blur=\"searchParam.restrictToSuggestedValues !== true ? false : true\" placeholder=\"{{searchParam.placeholder}}\"></div></div><input name=searchbox class=search-parameter-input nit-auto-size-input set-focus-on=searchbox ng-keydown=keydown($event) placeholder={{placeholder}} ng-focus=\"focus = true\" ng-blur=\"focus = false\" uib-typeahead=\"parameter as parameter.name for parameter in parameters | filter:isUnsedParameter | filter:{name:$viewValue} | limitTo:parametersDisplayLimit\" typeahead-on-select=\"searchQueryTypeaheadOnSelect($item, $model, $label)\" ng-change=searchQueryChanged(searchQuery) ng-model=\"searchQuery\"></div><div class=search-parameter-suggestions ng-show=\"parameters && focus\"><span class=title>{{parametersLabel}}:</span> <span class=search-parameter ng-repeat=\"param in parameters | filter:isUnsedParameter | limitTo:parametersDisplayLimit\" data-key={{param.key}} ng-mousedown=addSearchParam(param)>{{param.name}} <i ng-class=\"{'glyphicon glyphicon-plus': param.allowMultiple}\"></i></span></div></div>"
"<div class=advancedSearchBox ng-class={active:focus} ng-init=\"focus = false\" ng-click=\"!focus ? setFocusFor('searchbox') : null\"><span ng-show=\"searchParams.length < 1 && searchQuery.length === 0\" class=\"search-icon glyphicon glyphicon-search\"></span> <a ng-href=\"\" ng-show=\"searchParams.length > 0 || searchQuery.length > 0\" ng-click=removeAll() role=button><span class=\"remove-all-icon glyphicon glyphicon-trash\"></span></a><div><div class=search-parameter ng-repeat=\"searchParam in searchParams\"><a ng-href=\"\" ng-click=removeSearchParam($index) role=button><span class=\"remove glyphicon glyphicon-trash\"></span></a><div class=key data-key={{searchParam.key}} ng-click=\"enterEditMode($event, $index)\">{{searchParam.name}}:</div><div class=value><span ng-show=!searchParam.editMode ng-click=\"enterEditMode($event, $index)\">{{searchParam.value}}</span> <input name=value type={{searchParam.type}} nit-auto-size-input set-focus-on=\"{{'searchParam:' + searchParam.key}}\" ng-keydown=\"keydown($event, $index)\" ng-blur=\"leaveEditMode($event, $index)\" ng-show=searchParam.editMode ng-change=\"searchParam.restrictToSuggestedValues !== true ? searchParamValueChanged(searchParam) : null\" ng-model=searchParam.value uib-typeahead=\"suggestedValue for suggestedValue in searchParam.suggestedValues | filter:$viewValue\" typeahead-min-length=0 typeahead-on-select=\"searchParamTypeaheadOnSelect($item, searchParam)\" typeahead-editable=\"searchParam.restrictToSuggestedValues !== true\" typeahead-select-on-exact=true typeahead-select-on-blur=\"searchParam.restrictToSuggestedValues !== true ? false : true\" placeholder={{searchParam.placeholder}} ng-click=\"enterEditMode($event, $index)\"></div></div><input name=searchbox class=search-parameter-input nit-auto-size-input set-focus-on=searchbox ng-keydown=keydown($event) placeholder={{placeholder}} ng-focus=\"focus = true\" ng-blur=\"focus = false\" uib-typeahead=\"parameter as parameter.name for parameter in parameters | filter:isUnsedParameter | filter:{name:$viewValue} | limitTo:parametersDisplayLimit\" typeahead-on-select=\"searchQueryTypeaheadOnSelect($item, $model, $label)\" ng-change=searchQueryChanged(searchQuery) ng-model=\"searchQuery\"></div><div class=search-parameter-suggestions ng-show=\"parameters && focus && canAddParameter()\"><span class=title>{{parametersLabel}}:</span> <span class=search-parameter ng-repeat=\"param in parameters | filter:isUnsedParameter | limitTo:parametersDisplayLimit\" data-key={{param.key}} ng-mousedown=addSearchParam(param)>{{param.name}} <i ng-class=\"{'glyphicon glyphicon-plus': param.allowMultiple}\"></i></span></div></div>"
);

}]);
4 changes: 2 additions & 2 deletions dist/angular-advanced-searchbox-tpls.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/angular-advanced-searchbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
typeahead-editable="searchParam.restrictToSuggestedValues !== true"
typeahead-select-on-exact="true"
typeahead-select-on-blur="searchParam.restrictToSuggestedValues !== true ? false : true"
placeholder="{{searchParam.placeholder}}" />
placeholder="{{searchParam.placeholder}}"
ng-click="enterEditMode($event, $index)" />
</div>
</div>
<input name="searchbox"
Expand All @@ -43,7 +44,7 @@
ng-change="searchQueryChanged(searchQuery)"
ng-model="searchQuery" />
</div>
<div class="search-parameter-suggestions" ng-show="parameters && focus">
<div class="search-parameter-suggestions" ng-show="parameters && focus && canAddParameter()">
<span class="title">{{parametersLabel}}:</span>
<span class="search-parameter" ng-repeat="param in parameters | filter:isUnsedParameter | limitTo:parametersDisplayLimit"
data-key="{{param.key}}"
Expand Down
15 changes: 15 additions & 0 deletions dist/angular-advanced-searchbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ angular.module('angular-advanced-searchbox', [])
return $filter('filter')($scope.searchParams, function (param) { return param.key === value.key && !param.allowMultiple; }).length === 0;
};

$scope.canAddParameter = function () {
var availableParameters = $scope.parameters.length;
for (var i = 0; i < $scope.parameters.length; i++) {
if (!$scope.parameters[i].allowMultiple) {
for ( var j = 0; j < $scope.searchParams.length; j++) {
if ($scope.parameters[i].key === $scope.searchParams[j].key) {
availableParameters -= 1;
break;
}
}
}
}
return availableParameters > 0;
};

$scope.addSearchParam = function (searchParam, value, enterEditModel) {
if (enterEditModel === undefined)
enterEditModel = true;
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-advanced-searchbox.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e536e6

Please sign in to comment.