Skip to content

Commit

Permalink
release v1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed Feb 17, 2016
1 parent 201bd7e commit a1b3d49
Show file tree
Hide file tree
Showing 142 changed files with 338 additions and 190 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Checkout the [documentation](http://silviomoreto.github.io/bootstrap-select) for

**N.B.**: The CDN is updated after the release is made public, which means that there is a delay between the publishing of a release and its availability on the CDN. Check [the GitHub page](https://github.com/silviomoreto/bootstrap-select/releases) for the latest release.

* [//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.4/css/bootstrap-select.min.css](//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.4/css/bootstrap-select.min.css)
* [//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.4/js/bootstrap-select.min.js](//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.4/js/bootstrap-select.min.js)
* //cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.4/js/i18n/defaults-*.min.js (The translation files)
* [//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/css/bootstrap-select.min.css](//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/css/bootstrap-select.min.css)
* [//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/js/bootstrap-select.min.js](//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/js/bootstrap-select.min.js)
* //cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/js/i18n/defaults-*.min.js (The translation files)

## Bugs and feature requests

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"replacement"
],
"homepage": "http://silviomoreto.github.io/bootstrap-select",
"version": "1.9.4",
"version": "1.10.0",
"authors": [
{
"name": "Silvio Moreto",
Expand Down
9 changes: 7 additions & 2 deletions dist/css/bootstrap-select.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap-select.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/css/bootstrap-select.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 40 additions & 22 deletions dist/js/bootstrap-select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Bootstrap-select v1.9.4 (http://silviomoreto.github.io/bootstrap-select)
* Bootstrap-select v1.10.0 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
Expand Down Expand Up @@ -287,7 +287,7 @@
this.init();
};

Selectpicker.VERSION = '1.9.4';
Selectpicker.VERSION = '1.10.0';

// part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both.
Selectpicker.DEFAULTS = {
Expand Down Expand Up @@ -327,6 +327,7 @@
actionsBox: false,
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
showTick: false,
template: {
caret: '<span class="caret"></span>'
},
Expand All @@ -344,6 +345,8 @@
var that = this,
id = this.$element.attr('id');

this.$element.addClass('bs-select-hidden');

// store originalIndex (key) and newIndex (value) in this.liObj for fast accessibility
// allows us to do this.$lis.eq(that.liObj[index]) instead of this.$lis.filter('[data-original-index="' + index + '"]')
this.liObj = {};
Expand All @@ -358,6 +361,8 @@
this.$menuInner = this.$menu.children('.inner');
this.$searchbox = this.$menu.find('input');

this.$element.removeClass('bs-select-hidden');

if (this.options.dropdownAlignRight)
this.$menu.addClass('dropdown-menu-right');

Expand Down Expand Up @@ -428,8 +433,8 @@

createDropdown: function () {
// Options
// If we are multiple, then add the show-tick class by default
var multiple = this.multiple ? ' show-tick' : '',
// If we are multiple or showTick option is set, then add the show-tick class
var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',
inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '',
autofocus = this.autofocus ? ' autofocus' : '';
// Elements
Expand Down Expand Up @@ -462,7 +467,7 @@
'</div>'
: '';
var drop =
'<div class="btn-group bootstrap-select' + multiple + inputGroup + '">' +
'<div class="btn-group bootstrap-select' + showTick + inputGroup + '">' +
'<button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + autofocus + '>' +
'<span class="filter-option pull-left"></span>&nbsp;' +
'<span class="bs-caret">' +
Expand Down Expand Up @@ -1082,20 +1087,21 @@

this.$button.on('click', function () {
that.setSize();
that.$element.on('shown.bs.select', function () {
if (!that.options.liveSearch && !that.multiple) {
that.$menuInner.find('.selected a').focus();
} else if (!that.multiple) {
var selectedIndex = that.liObj[that.$element[0].selectedIndex];

if (typeof selectedIndex !== 'number' || that.options.size === false) return;

// scroll to selected option
var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop;
offset = offset - that.$menuInner[0].offsetHeight/2 + that.sizeInfo.liHeight/2;
that.$menuInner[0].scrollTop = offset;
}
});
});

this.$element.on('shown.bs.select', function () {
if (!that.options.liveSearch && !that.multiple) {
that.$menuInner.find('.selected a').focus();
} else if (!that.multiple) {
var selectedIndex = that.liObj[that.$element[0].selectedIndex];

if (typeof selectedIndex !== 'number' || that.options.size === false) return;

// scroll to selected option
var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop;
offset = offset - that.$menuInner[0].offsetHeight/2 + that.sizeInfo.liHeight/2;
that.$menuInner[0].scrollTop = offset;
}
});

this.$menuInner.on('click', 'li a', function (e) {
Expand Down Expand Up @@ -1193,9 +1199,10 @@

// Trigger select 'change'
if ((prevValue != that.$element.val() && that.multiple) || (prevIndex != that.$element.prop('selectedIndex') && !that.multiple)) {
that.$element.triggerNative('change');
// $option.prop('selected') is current option state (selected/unselected). state is previous option state.
that.$element.trigger('changed.bs.select', [clickedIndex, $option.prop('selected'), state]);
that.$element
.trigger('changed.bs.select', [clickedIndex, $option.prop('selected'), state])
.triggerNative('change');
}
}
});
Expand Down Expand Up @@ -1245,7 +1252,6 @@
} else {
that.deselectAll();
}
that.$element.triggerNative('change');
});

this.$element.change(function () {
Expand Down Expand Up @@ -1368,6 +1374,10 @@
$(selectedOptions).prop('selected', status);

this.render(false);

this.$element
.trigger('changed.bs.select')
.triggerNative('change');
},

selectAll: function () {
Expand All @@ -1378,6 +1388,14 @@
return this.changeAll(false);
},

toggle: function (e) {
e = e || window.event;

if (e) e.stopPropagation();

this.$button.trigger('click');
},

keydown: function (e) {
var $this = $(this),
$parent = $this.is('input') ? $this.parent().parent() : $this.parent(),
Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap-select.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/bootstrap-select.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/i18n/defaults-ar_AR.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Bootstrap-select v1.9.4 (http://silviomoreto.github.io/bootstrap-select)
* Bootstrap-select v1.10.0 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion dist/js/i18n/defaults-ar_AR.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Bootstrap-select v1.9.4 (http://silviomoreto.github.io/bootstrap-select)
* Bootstrap-select v1.10.0 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
Expand Down
Loading

0 comments on commit a1b3d49

Please sign in to comment.