Skip to content

Commit

Permalink
Added no-labels-label attribute support
Browse files Browse the repository at this point in the history
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)"
  • Loading branch information
maxidirienzo committed Apr 13, 2016
1 parent d558989 commit 43d5d33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions isteven-multi-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ')';
}
}
Expand Down

1 comment on commit 43d5d33

@maxidirienzo
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

if 3 items are selected, the button will show: "some label here (3)"

Please sign in to comment.