Skip to content

Commit

Permalink
Scrolltop and button bugfix, added compiled css files.
Browse files Browse the repository at this point in the history
  • Loading branch information
seahorsepip committed Sep 6, 2016
1 parent 5456892 commit c8901a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions js/jquery.jpopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ jPopup.prototype = {
this._config.animations.open[this._config.position].call(this);

//Button click
var r = $.Deferred();
this.elements.popup.on("click", "button", function(e) {
if($.contains(self.elements.buttons[0], this)) {
e.preventDefault();
Expand All @@ -466,6 +465,11 @@ jPopup.prototype = {
}
});

//Prevent form submission
this.elements.popup.on("submit", function(e) {
e.preventDefault();
});

//Close button click
this.elements.close.on("click", function(e) {
e.preventDefault();
Expand Down Expand Up @@ -532,6 +536,9 @@ jPopup.prototype = {
//Trigger animationend in case the wrapper might be removed too soon for custom animations to trigger animationend
self.elements.popup.trigger("animationend");

//Remove form submission event
self.elements.popup.off("submit");

//Remove overlay and wrapper from document body
self.elements.overlay.remove();
self.elements.wrapper.remove();
Expand Down Expand Up @@ -772,8 +779,8 @@ jPopup.prototype = {
return this._config.freeze;
},
_freeze: function() {
var top = $(window).scrollTop();
var left = $(window).scrollLeft();
var top = $(document).scrollTop();
var left = $(document).scrollLeft();
if(window.innerWidth > document.documentElement.clientWidth) {
$("html").css("overflow-y", "scroll");
}
Expand Down
Loading

0 comments on commit c8901a8

Please sign in to comment.