25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2 lines
3.3 KiB

  1. var R=(t,c)=>()=>(c||t((c={exports:{}}).exports,c),c.exports);var j=R((T,v)=>{(function(t){typeof define=="function"&&define.amd?define(["jquery"],t):typeof v<"u"&&v.exports?v.exports=t(require("jquery")):t(jQuery)})(function(t){var c=-1,_=-1,d=function(o){return parseFloat(o)||0},x=function(o){var n=1,a=t(o),h=null,r=[];return a.each(function(){var l=t(this),y=l.offset().top-d(l.css("margin-top")),u=r.length>0?r[r.length-1]:null;u===null?r.push(l):Math.floor(Math.abs(h-y))<=n?r[r.length-1]=u.add(l):r.push(l),h=y}),r},w=function(o){var n={byRow:!0,property:"height",target:null,remove:!1};return typeof o=="object"?t.extend(n,o):(typeof o=="boolean"?n.byRow=o:o==="remove"&&(n.remove=!0),n)},e=t.fn.matchHeight=function(o){var n=w(o);if(n.remove){var a=this;return this.css(n.property,""),t.each(e._groups,function(h,r){r.elements=r.elements.not(a)}),this}return this.length<=1&&!n.target?this:(e._groups.push({elements:this,options:n}),e._apply(this,n),this)};e.version="0.7.2",e._groups=[],e._throttle=80,e._maintainScroll=!1,e._beforeUpdate=null,e._afterUpdate=null,e._rows=x,e._parse=d,e._parseOptions=w,e._apply=function(o,n){var a=w(n),h=t(o),r=[h],l=t(window).scrollTop(),y=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var s=t(this);s.data("style-cache",s.attr("style"))}),u.css("display","block"),a.byRow&&!a.target&&(h.each(function(){var s=t(this),p=s.css("display");p!=="inline-block"&&p!=="flex"&&p!=="inline-flex"&&(p="block"),s.data("style-cache",s.attr("style")),s.css({display:p,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),r=x(h),h.each(function(){var s=t(this);s.attr("style",s.data("style-cache")||"")})),t.each(r,function(s,p){var b=t(p),m=0;if(a.target)m=a.target.outerHeight(!1);else{if(a.byRow&&b.length<=1)return void b.css(a.property,"");b.each(function(){var i=t(this),f=i.attr("style"),g=i.css("display");g!=="inline-block"&&g!=="flex"&&g!=="inline-flex"&&(g="block");var k={display:g};k[a.property]="",i.css(k),i.outerHeight(!1)>m&&(m=i.outerHeight(!1)),f?i.attr("style",f):i.css("display","")})}b.each(function(){var i=t(this),f=0;a.target&&i.is(a.target)||(i.css("box-sizing")!=="border-box"&&(f+=d(i.css("border-top-width"))+d(i.css("border-bottom-width")),f+=d(i.css("padding-top"))+d(i.css("padding-bottom"))),i.css(a.property,m-f+"px"))})}),u.each(function(){var s=t(this);s.attr("style",s.data("style-cache")||null)}),e._maintainScroll&&t(window).scrollTop(l/y*t("html").outerHeight(!0)),this},e._applyDataApi=function(){var o={};t("[data-match-height], [data-mh]").each(function(){var n=t(this),a=n.attr("data-mh")||n.attr("data-match-height");a in o?o[a]=o[a].add(n):o[a]=n}),t.each(o,function(){this.matchHeight(!0)})};var H=function(o){e._beforeUpdate&&e._beforeUpdate(o,e._groups),t.each(e._groups,function(){e._apply(this.elements,this.options)}),e._afterUpdate&&e._afterUpdate(o,e._groups)};e._update=function(o,n){if(n&&n.type==="resize"){var a=t(window).width();if(a===c)return;c=a}o?_===-1&&(_=setTimeout(function(){H(n),_=-1},e._throttle)):H(n)},t(e._applyDataApi);var U=t.fn.on?"on":"bind";t(window)[U]("load",function(o){e._update(!1,o)}),t(window)[U]("resize orientationchange",function(o){e._update(!0,o)})})});export default j();