Permalink
Browse files

Merge pull request #52 from ejhayes/next

Ok.
  • Loading branch information...
yanickrochon committed Dec 22, 2012
2 parents 28c94cc + 88a9c58 commit d222f0df05f5bc8e1c99e7a79417cecf5168693c
Showing with 15 additions and 1 deletion.
  1. +15 −1 js/ui.multiselect.js
View
@@ -93,9 +93,11 @@ $.widget("ui.multiselect", {
// callbacks
dataParser: defaultDataParser,
nodeComparator: defaultNodeComparator,
- nodeInserted: null
+ nodeInserted: null,
+ hidden: false
},
_create: function() {
+ if( !this.options.hidden){
this.element.hide();
this.busy = false; // busy state
this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
@@ -151,12 +153,24 @@ $.widget("ui.multiselect", {
// init lists
this._populateLists(this.element.find('option'));
+ } // end check for hidden attribute
},
/**************************************
* Public
**************************************/
+ slideToggle: function() {
+ if( this.options.hidden ){
+ this.options.hidden = !this.options.hidden; // this should no longer be hidden
+ this._create(); // now create it
+ }
+ else{
+ this.container.slideToggle(); // otherwise just toggle it
+ }
+
+ },
+
destroy: function() {
this.container.remove();
this.element.show();

0 comments on commit d222f0d

Please sign in to comment.