Skip to content

Commit

Permalink
Avoid having to set inline styles to hide modal by default. Fix issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguadoromero committed Oct 17, 2017
1 parent a9b77a9 commit 48b20e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jquery.modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
background-color: transparent;
}
.modal {
display: inline-block;
display: none;
vertical-align: middle;
position: relative;
z-index: 2;
Expand Down
5 changes: 3 additions & 2 deletions jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
}
} else {
this.$elm = el;
this.anchor = el;
this.$body.append(this.$elm);
this.open();
}
Expand Down Expand Up @@ -143,9 +144,9 @@
}
this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker);
if(this.options.doFade) {
this.$elm.css('opacity',0).show().animate({opacity: 1}, this.options.fadeDuration);
this.$elm.css({opacity: 0, display: 'inline-block'}).animate({opacity: 1}, this.options.fadeDuration);
} else {
this.$elm.show();
this.$elm.css('display', 'inline-block');
}
this.$elm.trigger($.modal.OPEN, [this._ctx()]);
},
Expand Down

0 comments on commit 48b20e4

Please sign in to comment.