diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..d610675 --- /dev/null +++ b/bower.json @@ -0,0 +1,29 @@ +{ + "name": "DualListBox", + "description": "jQuery DualListBox plugin with Bootstrap styling", + "version": "1.0.4", + "homepage": "https://github.com/CashStar/DualListBox", + "main": [ + "dist/dual-list-box.js" + ], + "keywords": [ + "dual-list-box", + "bootstrap", + "form", + "javascript", + "jquery", + "jquery-plugin" + ], + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "jquery": ">= 1.9.0", + "bootstrap": ">= 3.0.0" + }, + "devDependencies": {} +} diff --git a/dist/dual-list-box.js b/dist/dual-list-box.js index 8bdbc59..1b02742 100644 --- a/dist/dual-list-box.js +++ b/dist/dual-list-box.js @@ -167,6 +167,14 @@ addListeners(options); } + $.fn.refreshDualListBox = function(parentElement, timeout) { + var unselected = $(parentElement + ' .unselected'); + var selected = $(parentElement + ' .selected'); + unselected.filterByText($(parentElement + ' .filter-unselected'), timeout || 500, parentElement).scrollTop(0).sortOptions(); + selected.filterByText($(parentElement + ' .filter-selected'), timeout || 500, parentElement).scrollTop(0).sortOptions(); + countElements(parentElement); + } + /** Counts the elements per list box/select and shows it. */ function countElements(parentElement) { var countUnselected = 0, countSelected = 0; @@ -207,7 +215,7 @@ /** Creates the buttons when the dual list box is set in horizontal mode. */ function createHorizontalButtons(number, copyAllBtn) { if (number == 1) { - return (copyAllBtn ? ' ': '') + + return (copyAllBtn ? ' ': '') + ' '; } else { return ' ' + diff --git a/dist/dual-list-box.min.js b/dist/dual-list-box.min.js index c399c09..9d9fe62 100644 --- a/dist/dual-list-box.min.js +++ b/dist/dual-list-box.min.js @@ -5,22 +5,4 @@ * Copyright (c) 2014, Geodan B.V. (Alex van den Hoogen) * License: MIT License */ -!function(t){function e(e,n){var o=!1 - if(e.text.indexOf(":")>-1){var i=e.text.split(":") - i.length>1&&(o=!0)}t.getJSON(e.uri,function(s){t.each(s,function(l,s){var a="" - o?i.forEach(function(t){a+=s[t]+" "}):a=s[e.text],t("