Sha256: ddfed4b267ffff859f30e51683361109972163b62999b95e67e24eb8c44133d1
Contents?: true
Size: 1.46 KB
Versions: 2
Compression:
Stored size: 1.46 KB
Contents
(function(b,j){function l(){var a=h();a!==k&&(k=a,e.trigger("orientationchange"))}function m(){var a=e.width(),f=[],g=[],c;i.removeClass("min-width-"+d.join("px min-width-")+"px max-width-"+d.join("px max-width-")+"px");b.each(d,function(b,c){a>=c&&f.push("min-width-"+c+"px");a<=c&&g.push("max-width-"+c+"px")});f.length&&(c=f.join(" "));g.length&&(c+=" "+g.join(" "));i.addClass(c)}var e=b(j),i=b("html"),n=j.document,d=[320,480,768,1024];b.mh={};b.mh.media=function(){var a={},f=b("<div id='jquery-mediatest'>"), g=b("<body>").append(f);return function(c){if(!(c in a)){var d=b("<style type='text/css'>@media "+c+"{#jquery-mediatest{position:absolute;}}</style>");i.prepend(g).prepend(d);a[c]=f.css("position")==="absolute";g.add(d).remove()}return a[c]}}();var h,k;b.event.special.orientationchange={setup:function(){if("orientation"in j)return!1;k=h();e.bind("resize",l)},teardown:function(){if(b.support.orientation)return!1;e.unbind("resize",l)},add:function(a){var b=a.handler;a.handler=function(a){a.orientation= h();return b.apply(this,arguments)}}};h=function(){var a=n.documentElement;return a&&a.clientWidth/a.clientHeight<1.1?"portrait":"landscape"};b.mh.addResolutionBreakpoints=function(a){b.type(a)==="array"?d=d.concat(a):d.push(a);d.sort(function(a,b){return a-b});m()};e.bind("orientationchange.htmlclass resize.htmlclass",function(a){a.orientation&&i.removeClass("portrait landscape").addClass(a.orientation);m()});e.trigger("orientationchange.htmlclass")})(jQuery,this);
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
compass-jquery-plugin-0.3.3.1 | templates/jquery/jquery.mediahelpers.min.js |
compass-jquery-plugin-0.3.3.0 | templates/jquery/jquery.mediahelpers.min.js |