Skip to content

Commit

Permalink
Merge pull request #23 from MuhammadReda/master
Browse files Browse the repository at this point in the history
@MuhammadReda 👍 
Expose 2 chosen options to angular: placeholder_text_single & placeholder_text_multiple.
  • Loading branch information
adityasharat committed Mar 3, 2016
2 parents 003d29c + 4eab931 commit 39587d7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions angular-chosen.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* The MIT License (MIT)
*
*
* Copyright (c) 2016 Aditya Sharat
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -92,14 +92,18 @@

var allowSingleDeselect = iElm.attr('allow-single-deselect') !== undefined ? true : false;
var noResultsText = iElm.attr('no-results-text') !== undefined ? iAttr.noResultsText : "No results found.";
var placeholderTextSingle = iElm.attr('placeholder-text-single') !== undefined ? iAttr.placeholderTextSingle : "Select an Option";
var placeholderTextMultiple = iElm.attr('placeholder-text-multiple') !== undefined ? iAttr.placeholderTextMultiple : "Select Some Options";

iElm.chosen({
width: '100%',
max_selected_options: maxSelection,
disable_search_threshold: searchThreshold,
search_contains: true,
allow_single_deselect: allowSingleDeselect,
no_results_text: noResultsText
no_results_text: noResultsText,
placeholder_text_single: placeholderTextSingle,
placeholder_text_multiple: placeholderTextMultiple
});

iElm.on('change', function () {
Expand Down

0 comments on commit 39587d7

Please sign in to comment.