diff --git a/README.md b/README.md index f78c2ca..0ed6784 100644 --- a/README.md +++ b/README.md @@ -178,9 +178,9 @@ You can also check out the Sproutcore [Automatic Image Scaling demo](http://show ## Size ## -Original Size: 3.33KB gzipped (10.43KB uncompressed) +Original Size: 3.5KB gzipped (12.72KB uncompressed) -Compiled Size: **1.6KB gzipped** (3.94KB uncompressed) +Compiled Size: **1.58KB gzipped** (3.86KB uncompressed) ## Author ## diff --git a/image-scale.jquery.json b/image-scale.jquery.json index 2dddc17..93ef37b 100755 --- a/image-scale.jquery.json +++ b/image-scale.jquery.json @@ -10,7 +10,7 @@ "responsive", "resize" ], - "version": "1.3.1", + "version": "1.3.2", "author": { "name": "GestiXi", "url": "https://github.com/GestiXi" diff --git a/image-scale.js b/image-scale.js index 9458229..807830d 100755 --- a/image-scale.js +++ b/image-scale.js @@ -3,7 +3,7 @@ // Description: Scale images to fit or fill any target size via two simple properties: scale and align. // Copyright: ©2012-2013 Nicolas BADIA // License: Licensed under the MIT license (see LICENCE) -// Version: 1.3.1 +// Version: 1.3.2 // ========================================================================== !function($) { "use strict"; diff --git a/image-scale.min.js b/image-scale.min.js index 01c0341..9da94eb 100755 --- a/image-scale.min.js +++ b/image-scale.min.js @@ -1,9 +1,9 @@ -/*! image-scale v1.3.1 | ©2012-2013 Nicolas BADIA | Licensed under the MIT license */ -!function(e){e.fn.imageScale=function(a){return this.each(function(){var b=e(this),c=b.data("imageScale");if(!c){b.css("opacity",0);var f=b[0].complete,g=e.extend({},e.fn.imageScale.defaults,"object"==typeof a&&a),h=function(){b.data("imageScale",c=new m(this,g));g.rescaleOnResize&&e(window).resize(function(a){c.scheduleScale()});c.scale(!0);var a=g.callback;"function"===typeof a?a(b,c):a&&"object"===typeof a&&a.target[a.action].apply(a.target,[b,c])};f?h.apply(b[0]):b.load(h)}else if("string"==typeof a)c[a]()})}; -e.fn.imageScale.defaults={scale:"best-fill",align:"center",parent:null,hideParentOverflow:!0,fadeInDuration:0,rescaleOnResize:!0,callback:null,debug:0};var m=function(a,b){this.options=b;this.element=a;var c=this.$element=e(a);this.elementWidth=c.attr("width")||a.width;this.elementHeight=c.attr("height")||a.height;this.$parent=b.parent?b.parent:e(e(a).parent()[0])};e.fn.imageScale.Constructor=m;m.prototype={NONE:"none",FILL:"fill",BEST_FILL:"best-fill",BEST_FIT:"best-fit",BEST_FIT_DOWN_ONLY:"best-fit-down", -ALIGN_LEFT:"left",ALIGN_RIGHT:"right",ALIGN_CENTER:"center",ALIGN_TOP:"top",ALIGN_BOTTOM:"bottom",ALIGN_TOP_LEFT:"top-left",ALIGN_TOP_RIGHT:"top-right",ALIGN_BOTTOM_LEFT:"bottom-left",ALIGN_BOTTOM_RIGHT:"bottom-right",constructor:m,scale:function(a){if(!this._isDestroyed){var b=this.options,c=this.$parent,f=this.element,g=this.$element;a&&(b.hideParentOverflow&&c.css({overflow:"hidden"}),g.css({opacity:1}));this._didScheduleScale=!1;if(!b.rescaleOnResize||this._needUpdate()){var h=c.outerWidth(), -l=c.outerHeight(),e=c.innerWidth(),c=c.innerHeight(),e=h-e,c=l-c,d=g.attr("data-scale"),n=g.attr("data-align"),d=d?d:b.scale,m=n?n:b.align,n=b.fadeInDuration;if(d){this._cacheDestWidth===h&&this._cacheDestHeight===l&&2k?e:k;break;case this.BEST_FIT:a=eg||f>h?ek?e:k;break;case this.BEST_FIT:a=ef||g>h?e