Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions js/ui.multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,7 @@ $.widget("ui.multiselect", {

var that = this;

// set dimensions
this.container.width(this.element.width()+1);
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));

// fix list height to match <option> depending on their individual header's heights
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
this._setDimensions();

if ( !this.options.animated ) {
this.options.show = 'show';
Expand Down Expand Up @@ -131,12 +124,34 @@ $.widget("ui.multiselect", {
return false;
});
},

refresh : function() {

// reset dimensions
this._setDimensions();

},

destroy: function() {
this.element.show();
this.container.remove();

$.Widget.prototype.destroy.apply(this, arguments);
},

_setDimensions : function() {

// set dimensions
this.container.width(this.element.width()+1);
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));

// fix list height to match <option> depending on their individual header's heights
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));

},

_populateLists: function(options) {
this.selectedList.children('.ui-element').remove();
this.availableList.children('.ui-element').remove();
Expand Down