}
var ce = this.el.select('.navbar-collapse',true).first();
- if (ce.hasClass('collapse')) {
+ if (!ce.hasClass('show')) {
this.expand();
} else {
this.collapse();
*/
expand : function ()
{
+
var ce = this.el.select('.navbar-collapse',true).first();
+ if (ce.hasClass('collapsing')) {
+ return;
+ }
+ ce.dom.style.height = '';
// show it...
ce.addClass('in'); // old...
ce.removeClass('collapse');
ce.dom.style.height = '';
}, this, { single: true} );
ce.setHeight(h);
+ ce.dom.scrollTop = 0;
},
/**
* Collapse the navbar pulldown
*/
collapse : function()
{
- var ce = this.el.select('.navbar-collapse',true).first();
+ var ce = this.el.select('.navbar-collapse',true).first();
+
+ if (ce.hasClass('collapsing') || ce.hasClass('collapse') ) {
+ // it's collapsed or collapsing..
+ return;
+ }
ce.removeClass('in'); // old...
ce.setHeight(ce.getHeight());
ce.removeClass('show');