Skip to content

Commit 4ebd072

Browse files
v3.0.6
1 parent ae8a3d6 commit 4ebd072

8 files changed

Lines changed: 69 additions & 22 deletions

bootstrap-duallistbox.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"input",
1010
"ui"
1111
],
12-
"version": "3.0.5",
12+
"version": "3.0.6",
1313
"author": {
1414
"name": "István Ujj-Mészáros",
1515
"url": "https://github.com/istvan-ujjmeszaros"

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bootstrap-duallistbox",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"homepage": "http://www.virtuosoft.eu/code/bootstrap-duallistbox/",
55
"authors": [
66
{

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": ["bootstrap", "bootstrap select", "select", "bootstrap duallistbox", "duallistbox"],
55
"description": "A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.",
66
"homepage": "http://www.virtuosoft.eu/code/bootstrap-duallistbox/",
7-
"version": "3.0.5",
7+
"version": "3.0.6",
88
"authors": [
99
{
1010
"name": "István Ujj-Mészáros",

dist/bootstrap-duallistbox.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Bootstrap Duallistbox - v3.0.5
2+
* Bootstrap Duallistbox - v3.0.6
33
* A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.
44
* http://www.virtuosoft.eu/code/bootstrap-duallistbox/
55
*

dist/bootstrap-duallistbox.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.bootstrap-duallistbox.js

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Bootstrap Duallistbox - v3.0.5
2+
* Bootstrap Duallistbox - v3.0.6
33
* A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.
44
* http://www.virtuosoft.eu/code/bootstrap-duallistbox/
55
*
@@ -30,7 +30,11 @@
3030
infoTextFiltered: '<span class="label label-warning">Filtered</span> {0} from {1}', // when not all of the options are visible due to the filter
3131
infoTextEmpty: 'Empty list', // when there are no options present in the list
3232
filterOnValues: false, // filter by selector's values, boolean
33-
sortByInputOrder: false
33+
sortByInputOrder: false,
34+
eventMoveOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead
35+
eventMoveAllOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead
36+
eventRemoveOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead
37+
eventRemoveAllOverride: false // boolean, allows user to unbind default event behaviour and run their own instead
3438
},
3539
// Selections are invisible on android if the containing select is styled with CSS
3640
// http://code.google.com/p/android/issues/detail?id=16922
@@ -255,6 +259,9 @@
255259
refreshSelects(dualListbox);
256260
triggerChangeEvent(dualListbox);
257261
sortOptions(dualListbox.elements.select1);
262+
if(dualListbox.settings.sortByInputOrder){
263+
sortOptionsByInputOrder(dualListbox.elements.select2);
264+
}
258265
}
259266

260267
function moveAll(dualListbox) {
@@ -321,21 +328,29 @@
321328
dualListbox.setSelectedFilter('', true);
322329
});
323330

324-
dualListbox.elements.moveButton.on('click', function() {
325-
move(dualListbox);
326-
});
331+
if (dualListbox.settings.eventMoveOverride === false) {
332+
dualListbox.elements.moveButton.on('click', function() {
333+
move(dualListbox);
334+
});
335+
}
327336

328-
dualListbox.elements.moveAllButton.on('click', function() {
329-
moveAll(dualListbox);
330-
});
337+
if (dualListbox.settings.eventMoveAllOverride === false) {
338+
dualListbox.elements.moveAllButton.on('click', function() {
339+
moveAll(dualListbox);
340+
});
341+
}
331342

332-
dualListbox.elements.removeButton.on('click', function() {
333-
remove(dualListbox);
334-
});
343+
if (dualListbox.settings.eventRemoveOverride === false) {
344+
dualListbox.elements.removeButton.on('click', function() {
345+
remove(dualListbox);
346+
});
347+
}
335348

336-
dualListbox.elements.removeAllButton.on('click', function() {
337-
removeAll(dualListbox);
338-
});
349+
if (dualListbox.settings.eventRemoveAllOverride === false) {
350+
dualListbox.elements.removeAllButton.on('click', function() {
351+
removeAll(dualListbox);
352+
});
353+
}
339354

340355
dualListbox.elements.filterInput1.on('change keyup', function() {
341356
filter(dualListbox, 1);
@@ -449,6 +464,10 @@
449464
this.setInfoTextEmpty(this.settings.infoTextEmpty);
450465
this.setFilterOnValues(this.settings.filterOnValues);
451466
this.setSortByInputOrder(this.settings.sortByInputOrder);
467+
this.setEventMoveOverride(this.settings.eventMoveOverride);
468+
this.setEventMoveAllOverride(this.settings.eventMoveAllOverride);
469+
this.setEventRemoveOverride(this.settings.eventRemoveOverride);
470+
this.setEventRemoveAllOverride(this.settings.eventRemoveAllOverride);
452471

453472
// Hide the original select
454473
this.element.hide();
@@ -690,6 +709,34 @@
690709
}
691710
return this.element;
692711
},
712+
setEventMoveOverride: function(value, refresh) {
713+
this.settings.eventMoveOverride = value;
714+
if (refresh) {
715+
refreshSelects(this);
716+
}
717+
return this.element;
718+
},
719+
setEventMoveAllOverride: function(value, refresh) {
720+
this.settings.eventMoveAllOverride = value;
721+
if (refresh) {
722+
refreshSelects(this);
723+
}
724+
return this.element;
725+
},
726+
setEventRemoveOverride: function(value, refresh) {
727+
this.settings.eventRemoveOverride = value;
728+
if (refresh) {
729+
refreshSelects(this);
730+
}
731+
return this.element;
732+
},
733+
setEventRemoveAllOverride: function(value, refresh) {
734+
this.settings.eventRemoveAllOverride = value;
735+
if (refresh) {
736+
refreshSelects(this);
737+
}
738+
return this.element;
739+
},
693740
getContainer: function() {
694741
return this.container;
695742
},

0 commit comments

Comments
 (0)