From 8f47e0105ee79962beddbe3ff28cc65a7124c09b Mon Sep 17 00:00:00 2001 From: tamtakoe Date: Fri, 4 Sep 2015 10:15:44 +0300 Subject: [PATCH] some fixes --- docs/examples/customization/template.html | 16 ++++++++-------- src/directives.js | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/examples/customization/template.html b/docs/examples/customization/template.html index 2a9a047..6ebf88f 100644 --- a/docs/examples/customization/template.html +++ b/docs/examples/customization/template.html @@ -33,28 +33,28 @@

Customization

}"
-.filter('mySearchFilter', ['$sce', function($sce) { - return function(label) { +.filter('mySearchFilter', function($sce) { + return function(label, query, item, options) { var html = '' + label + ''; return $sce.trustAsHtml(html); }; -}]) +})
-.filter('myDropdownFilter', ['$sce', function($sce) { - return function(label, query, option) { +.filter('myDropdownFilter', function($sce) { + return function(label, query, item, options) { - var html = '#' + option.id + ' ' + label; + var html = '#' + item.id + ' ' + label; return $sce.trustAsHtml(html); }; -}]); +});
.filter('myListFilter', function() { - return function (list, query, getLabel) { + return function (list, query, getLabel, options) { return list; } }); diff --git a/src/directives.js b/src/directives.js index 05f0ef5..aac7324 100644 --- a/src/directives.js +++ b/src/directives.js @@ -331,16 +331,16 @@ angular.module('oi.select') } }; - scope.getSearchLabel = function(option) { - var label = getLabel(option); + scope.getSearchLabel = function(item) { + var label = getLabel(item); - return searchFilter(label, scope.oldQuery || scope.query, option, searchFilterOptionsFn(scope.$parent)); + return searchFilter(label, scope.oldQuery || scope.query, item, searchFilterOptionsFn(scope.$parent)); }; - scope.getDropdownLabel = function(option) { - var label = getLabel(option); + scope.getDropdownLabel = function(item) { + var label = getLabel(item); - return dropdownFilter(label, scope.oldQuery || scope.query, option, dropdownFilterOptionsFn(scope.$parent)); + return dropdownFilter(label, scope.oldQuery || scope.query, item, dropdownFilterOptionsFn(scope.$parent)); }; scope.getDisableWhen = getDisableWhen;