From 43d5d33cf397bcca63f9fcc4760a70333a1f5f25 Mon Sep 17 00:00:00 2001 From: Maxi Di Rienzo Date: Wed, 13 Apr 2016 12:32:21 -0300 Subject: [PATCH] Added no-labels-label attribute support When using max-labels="0" this PR supports an additional attribute named "no-labels-label" to specify a label to be displayed before the selected items count, example: no-labels-label="some label here" if 3 items are selected, the button will show: "some label here (3)" --- isteven-multi-select.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/isteven-multi-select.js b/isteven-multi-select.js index b5d3465..73d5637 100644 --- a/isteven-multi-select.js +++ b/isteven-multi-select.js @@ -550,6 +550,9 @@ angular.module( 'isteven-multi-select', ['ng'] ).directive( 'istevenMultiSelect' if (tempMaxLabels > 0) { $scope.varButtonLabel += ', ... '; } + else if ( typeof attrs.noLabelsLabel !== 'undefined' && attrs.noLabelsLabel !== '' ) { + $scope.varButtonLabel += attrs.noLabelsLabel + ' '; + } $scope.varButtonLabel += '(' + $scope.outputModel.length + ')'; } }