Permalink
Browse files

Add sizes.minW and sizes.minH settings. Closes #8

  • Loading branch information...
1 parent d6d14e5 commit ba819674fd1f3eb35983d1ebd7c9499e24808792 @nyroDev committed Jan 9, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 js/jquery.nyroModal.js
@@ -51,6 +51,8 @@ jQuery(function($, undefined) {
initH: undefined, // Initial height
w: undefined, // width
h: undefined, // height
+ minW: undefined, // minimum Width
+ minH: undefined, // minimum height
wMargin: undefined, // Horizontal margin
hMargin: undefined // Vertical margin
},
@@ -126,6 +128,10 @@ jQuery(function($, undefined) {
size: function() {
var maxHeight = this.getInternal().fullSize.viewH - this.sizes.hMargin,
maxWidth = this.getInternal().fullSize.viewW - this.sizes.wMargin;
+ if (this.sizes.minW && this.sizes.minW > this.sizes.w)
+ this.sizes.w = this.sizes.minW;
+ if (this.sizes.minH && this.sizes.minH > this.sizes.h)
+ this.sizes.h = this.sizes.minH;
if (this.sizes.h > maxHeight || this.sizes.w > maxWidth) {
// We're gonna resize the modal as it will goes outside the view port
this.sizes.h = Math.min(this.sizes.h, maxHeight);

0 comments on commit ba81967

Please sign in to comment.