Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasJang committed Sep 8, 2016
1 parent 37e9f14 commit 965a445
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ax5ui-modal",
"version": "0.7.6",
"version": "0.7.7",
"authors": [
"ThomasJ <[email protected]>"
],
Expand Down
23 changes: 14 additions & 9 deletions dist/ax5modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

UI.addClass({
className: "modal",
version: "0.7.6"
version: "0.7.7"
}, function () {
/**
* @class ax5modal
Expand Down Expand Up @@ -361,8 +361,10 @@
jQuery(window).unbind("resize.ax-modal");

setTimeout(function () {
this.activeModal.remove();
this.activeModal = null;
if (this.activeModal) {
this.activeModal.remove();
this.activeModal = null;
}
onStateChanged.call(this, opts, {
self: this,
state: "close"
Expand Down Expand Up @@ -479,15 +481,11 @@
if (fullScreen) {
if (opts.header) this.$.header.hide();
box.width = jQuery(window).width();
box.height = jQuery(window).height();
box.height = opts.height;
box.left = 0;
box.top = 0;

if (opts.iframe) {
this.$["iframe-wrap"].css({ height: box.height });
this.$["iframe"].css({ height: box.height });
}
} else {
if (opts.header) this.$.header.show();
if (position) {
jQuery.extend(true, opts.position, position);
}
Expand Down Expand Up @@ -517,9 +515,16 @@
} else {
box.top = opts.position.top || 0;
}
if (box.left < 0) box.left = 0;
if (box.top < 0) box.top = 0;
}

this.activeModal.css(box);

if (opts.iframe) {
this.$["iframe-wrap"].css({ height: box.height });
this.$["iframe"].css({ height: box.height });
}
return this;
};
}();
Expand Down
2 changes: 1 addition & 1 deletion dist/ax5modal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ax5ui-modal",
"version": "0.7.6",
"version": "0.7.7",
"description": "A modal plugin that works with Bootstrap & jQuery",
"license": "LGPLv3",
"repository": {
Expand Down
24 changes: 14 additions & 10 deletions src/ax5modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

UI.addClass({
className: "modal",
version : "0.7.6"
version : "0.7.7"
}, (function () {
/**
* @class ax5modal
Expand Down Expand Up @@ -414,8 +414,10 @@
jQuery(window).unbind("resize.ax-modal");

setTimeout((function () {
this.activeModal.remove();
this.activeModal = null;
if(this.activeModal) {
this.activeModal.remove();
this.activeModal = null;
}
onStateChanged.call(this, opts, {
self : this,
state: "close"
Expand Down Expand Up @@ -532,16 +534,12 @@
if (fullScreen) {
if (opts.header) this.$.header.hide();
box.width = jQuery(window).width();
box.height = jQuery(window).height();
box.height = opts.height;
box.left = 0;
box.top = 0;

if (opts.iframe) {
this.$["iframe-wrap"].css({height: box.height});
this.$["iframe"].css({height: box.height});
}
}
else {
if (opts.header) this.$.header.show();
if (position) {
jQuery.extend(true, opts.position, position);
}
Expand Down Expand Up @@ -577,10 +575,16 @@
else {
box.top = opts.position.top || 0;
}

if(box.left < 0) box.left = 0;
if(box.top < 0) box.top = 0;
}

this.activeModal.css(box);

if (opts.iframe) {
this.$["iframe-wrap"].css({height: box.height});
this.$["iframe"].css({height: box.height});
}
return this;
};
})();
Expand Down
1 change: 0 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<button class="btn btn-danger" id="modal-open">Modal open</button>
<button class="btn btn-danger" id="modal-close">Modal close</button>
<button class="btn btn-danger" id="modal-full">Modal opend full</button>

<div style="height: 1000px;"></div>

Expand Down

0 comments on commit 965a445

Please sign in to comment.