Skip to content

Commit

Permalink
Adding logic so that applies even w/ the mask enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Sep 10, 2012
1 parent 899c4b0 commit 069352b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
16 changes: 16 additions & 0 deletions Source/Behaviors/Behavior.BS.Tabs.js
Expand Up @@ -44,6 +44,22 @@ provides: [Behavior.BS.Tabs]
var tab = instance.tabs[now];
var section = tab.retrieve('section');
instance.fireEvent('active', [now, section, tab]);

var sections = instance.tabs.map(function(tab){
return tab.retrieve('section');
});

el.addEvent('click:relay(a[href^=#])', function(event, link){
if (link.get('href') == "#") return;
var target = el.getElement(link.get('href'));
if (instance.tabs.contains(target)) return;
if (!target) api.warn('Could not switch tab; no section found for ' + link.get('href'));
if (sections.contains(target)) {
event.preventDefault();
instance.show(sections.indexOf(target));
}
});

});

})();
16 changes: 6 additions & 10 deletions Source/UI/Bootstrap.Popup.js
Expand Up @@ -162,17 +162,13 @@ Bootstrap.Popup = new Class({
_makeMask: function(){
if (this.options.mask){
if (!this._mask){
this._mask = new Element('div.modal-backdrop', {
events: {
click: this.bound.hide
}
});
if (this._checkAnimate()){
this._mask.addClass('fade');
}
this._mask = new Element('div.modal-backdrop');
if (this._checkAnimate()) this._mask.addClass('fade');
}
} else if (this.options.closeOnClickOut){
document.id(document.body).addEvent('click', this.bound.hide);
}
if (this.options.closeOnClickOut){
if (this._mask) this._mask.addEvent('click', this.bound.hide);
else document.id(document.body).addEvent('click', this.bound.hide);
}
}

Expand Down

0 comments on commit 069352b

Please sign in to comment.