Skip to content

Commit

Permalink
Merge pull request #5 from adidas/feature/update-choices-library
Browse files Browse the repository at this point in the history
Update Choices.js library to v4.1.3
  • Loading branch information
RecuencoJones authored Dec 4, 2018
2 parents 60f7f7d + cc296f9 commit af2bdb4
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 384 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ deploy:
email: uxteam@adidas-group.com
api_key: $NPM_TOKEN
on:
branch: master
tags: true
condition: $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+
- provider: pages
skip-cleanup: true
local-dir: ./example
github-token: $GITHUB_TOKEN
on:
branch: master
tags: true
condition: $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 1.2.0

- Updated to Choices.js v4.1.3. Changes:
- Renamed property `duplicateItems` to `duplicateItemsAllowed`.
- Renamed property `sortFilter` to `sortFn`.
- Renamed property `removeItemsByValue` to `removeActiveItemsByValue`.
- Renamed property `setValueByChoice` to `setChoiceByValue`.
- Modfied `callbackOnCreateTemplates` which receives the class names as first argument (`this.config.classNames`).
- Removed `sass-inline-svg` dependency because the assets are now bundled along with the CSS.
- Updated TravisCI configuration to publish on tags.
- Updated example.

## 1.1.1

- Fixed placeholder behavior to avoid input dynamic width.
Expand Down
16 changes: 8 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/choices.js/3.0.4/choices.js"></script>
<script src="https://rawgit.com/jshjohnson/Choices/v4.1.3/public/assets/scripts/choices.js"></script>
<script src="dist/choicesjsstencil.js"></script>
<style>
html {
Expand Down Expand Up @@ -217,9 +217,9 @@ <h2 class="col-sm-12">ChoicesJS Web Component: test page</h2>
</span>
</div>
<div class="form-group type type--text type--multiple">
<label for="duplicateItems">
<label for="duplicateItemsAllowed">
Duplicate items
<input type="checkbox" name="duplicateItems" checked>
<input type="checkbox" name="duplicateItemsAllowed" checked>
</label>
<span class="description" data-toggle="tooltip" title="Whether each inputted/chosen item should be unique.">
<span class="glyphicon glyphicon glyphicon-question-sign"></span>
Expand Down Expand Up @@ -501,16 +501,16 @@ <h2 class="col-sm-12">ChoicesJS Web Component: test page</h2>
</a>
</div>
<div class="form-group type type--single type--multiple">
<label for="sortFilter">
sortFilter(a, b) {
<label for="sortFn">
sortFn(a, b) {
</label>
<span class="description" data-toggle="tooltip" title="The function that will sort choices and items before they are displayed (unless a user is searching). By default choices and items are sorted by alphabetical order.<br/><br/>The function takes two parameters: a, b.">
<span class="glyphicon glyphicon glyphicon-question-sign"></span>
</span>
<textarea class="form-control textarea--vertical" name="sortFilter" rows="2">
<textarea class="form-control textarea--vertical" name="sortFn" rows="2">
return a.label.localeCompare(b.label);
</textarea>
<label for="sortFilter">}</label>
<label for="sortFn">}</label>
</div>
</div>
</div>
Expand Down Expand Up @@ -804,7 +804,7 @@ <h5 class="text-center pad-bottom">See full Fuse documentation in <a href="https
return template.replace('${maxItemCount}', maxItemCount);
};
},
sortFilter: function(value) {
sortFn: function(value) {
return new Function('a', 'b', value.trim());
},
callbackOnInit: function(value) {
Expand Down
Loading

0 comments on commit af2bdb4

Please sign in to comment.