Permalink
Browse files

Adding changeDisplayValue to popup implementation, which allows you t…

…o toggle display from block to none.
  • Loading branch information...
anutron committed Aug 14, 2012
1 parent 71b78f2 commit e2d1dd49ddbe11240fce2110a31470ec65086935
Showing with 5 additions and 1 deletion.
  1. +1 −0 Docs/UI/Bootstrap.Popup.md
  2. +4 −1 Source/UI/Bootstrap.Popup.js
@@ -27,6 +27,7 @@ Bootstrap.Popover Method: constructor
* closeOnEsc - (*boolean*) When `true` (the default) the popup is closed when the user hits escape.
* mask - (*boolean*) When `true` (the default) a mask is placed below the popup element.
* animate - (*boolean*) When `true` (the default) the mask and the window are displayed with a transition effect.
+* changeDisplayValue (*boolean*) When `true` (the default), the popup element's `display` property is toggled between `block` and `none` on the end of the transitions.
### Events
@@ -41,7 +41,8 @@ Bootstrap.Popup = new Class({
closeOnClickOut: true,
closeOnEsc: true,
mask: true,
- animate: true
+ animate: true,
+ changeDisplayValue: true
},
initialize: function(element, options){
@@ -85,6 +86,7 @@ Bootstrap.Popup = new Class({
this._makeMask();
this._mask.inject(document.body);
this.animating = true;
+ if (this.options.changeDisplayValue) this.element.show();
if (this._checkAnimate()){
this.element.offsetWidth; // force reflow
this.element.addClass('in');
@@ -109,6 +111,7 @@ Bootstrap.Popup = new Class({
this.fireEvent('show', this.element);
} else {
this.fireEvent('hide', this.element);
+ if (this.options.changeDisplayValue) this.element.hide();
if (!this.options.persist){
this.destroy();
} else {

0 comments on commit e2d1dd4

Please sign in to comment.