diff --git a/js/ui.multiselect.js b/js/ui.multiselect.js old mode 100755 new mode 100644 index 1234fa7..44a64ba --- a/js/ui.multiselect.js +++ b/js/ui.multiselect.js @@ -35,7 +35,10 @@ $.widget("ui.multiselect", { animated: 'fast', show: 'slideDown', hide: 'slideUp', - dividerLocation: 0.6, + titleAvailable: '', + titleSelected: '', + leftToRight: true, + dividerLocation: 0.5, nodeComparator: function(node1,node2) { var text1 = node1.text(), text2 = node2.text(); @@ -47,10 +50,23 @@ $.widget("ui.multiselect", { this.id = this.element.attr("id"); this.container = $('
').insertAfter(this.element); this.count = 0; // number of currently selected options - this.selectedContainer = $('
').appendTo(this.container); - this.availableContainer = $('
').appendTo(this.container); - this.selectedActions = $('
0 '+$.ui.multiselect.locale.itemsCount+''+$.ui.multiselect.locale.removeAll+'
').appendTo(this.selectedContainer); - this.availableActions = $('
'+$.ui.multiselect.locale.addAll+'
').appendTo(this.availableContainer); + if(this.options.leftToRight) { + this.availableContainer = $('
').appendTo(this.container); + this.selectedContainer = $('
').appendTo(this.container); + } else { + this.selectedContainer = $('
').appendTo(this.container); + this.availableContainer = $('
').appendTo(this.container); + } + + if(this.options.titleAvailable != '') { + this.options.titleAvailable = '' + this.options.titleAvailable +'
'; + } + if(this.options.titleSelected != '') { + this.options.titleSelected = '' + this.options.titleSelected +'
'; + } + + this.selectedActions = $('
' + this.options.titleSelected +'0 '+$.ui.multiselect.locale.itemsCount+''+$.ui.multiselect.locale.removeAll+'
').appendTo(this.selectedContainer); + this.availableActions = $('
' + this.options.titleAvailable +''+$.ui.multiselect.locale.addAll+'
').appendTo(this.availableContainer); this.selectedList = $('').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer); this.availableList = $('').bind('selectstart', function(){return false;}).appendTo(this.availableContainer); @@ -62,8 +78,10 @@ $.widget("ui.multiselect", { this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation))); // fix list height to match