ff05f62f642a537a47e20ae6d5d577ee.json
3.63 KB
{"ast":null,"code":"/* eslint-disable import/prefer-default-export */\nfunction getScroll(w) {\n var ret = w.pageXOffset;\n var method = 'scrollLeft';\n\n if (typeof ret !== 'number') {\n var d = w.document; // ie6,7,8 standard mode\n\n ret = d.documentElement[method];\n\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n\n return ret;\n}\n\nfunction getClientPosition(elem) {\n var x;\n var y;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n var box = elem.getBoundingClientRect();\n x = box.left;\n y = box.top;\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n return {\n left: x,\n top: y\n };\n}\n\nexport function getOffsetLeft(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument; // Only IE use `parentWindow`\n\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScroll(w);\n return pos.left;\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-rate/es/util.js"],"names":["getScroll","w","ret","pageXOffset","method","d","document","documentElement","body","getClientPosition","elem","x","y","doc","ownerDocument","docElem","box","getBoundingClientRect","left","top","clientLeft","clientTop","getOffsetLeft","el","pos","defaultView","parentWindow"],"mappings":"AAAA;AACA,SAASA,SAAT,CAAmBC,CAAnB,EAAsB;AACpB,MAAIC,GAAG,GAAGD,CAAC,CAACE,WAAZ;AACA,MAAIC,MAAM,GAAG,YAAb;;AAEA,MAAI,OAAOF,GAAP,KAAe,QAAnB,EAA6B;AAC3B,QAAIG,CAAC,GAAGJ,CAAC,CAACK,QAAV,CAD2B,CACP;;AAEpBJ,IAAAA,GAAG,GAAGG,CAAC,CAACE,eAAF,CAAkBH,MAAlB,CAAN;;AAEA,QAAI,OAAOF,GAAP,KAAe,QAAnB,EAA6B;AAC3B;AACAA,MAAAA,GAAG,GAAGG,CAAC,CAACG,IAAF,CAAOJ,MAAP,CAAN;AACD;AACF;;AAED,SAAOF,GAAP;AACD;;AAED,SAASO,iBAAT,CAA2BC,IAA3B,EAAiC;AAC/B,MAAIC,CAAJ;AACA,MAAIC,CAAJ;AACA,MAAIC,GAAG,GAAGH,IAAI,CAACI,aAAf;AACA,MAAIN,IAAI,GAAGK,GAAG,CAACL,IAAf;AACA,MAAIO,OAAO,GAAGF,GAAG,IAAIA,GAAG,CAACN,eAAzB;AACA,MAAIS,GAAG,GAAGN,IAAI,CAACO,qBAAL,EAAV;AACAN,EAAAA,CAAC,GAAGK,GAAG,CAACE,IAAR;AACAN,EAAAA,CAAC,GAAGI,GAAG,CAACG,GAAR;AACAR,EAAAA,CAAC,IAAII,OAAO,CAACK,UAAR,IAAsBZ,IAAI,CAACY,UAA3B,IAAyC,CAA9C;AACAR,EAAAA,CAAC,IAAIG,OAAO,CAACM,SAAR,IAAqBb,IAAI,CAACa,SAA1B,IAAuC,CAA5C;AACA,SAAO;AACLH,IAAAA,IAAI,EAAEP,CADD;AAELQ,IAAAA,GAAG,EAAEP;AAFA,GAAP;AAID;;AAED,OAAO,SAASU,aAAT,CAAuBC,EAAvB,EAA2B;AAChC,MAAIC,GAAG,GAAGf,iBAAiB,CAACc,EAAD,CAA3B;AACA,MAAIV,GAAG,GAAGU,EAAE,CAACT,aAAb,CAFgC,CAEJ;;AAE5B,MAAIb,CAAC,GAAGY,GAAG,CAACY,WAAJ,IAAmBZ,GAAG,CAACa,YAA/B;AACAF,EAAAA,GAAG,CAACN,IAAJ,IAAYlB,SAAS,CAACC,CAAD,CAArB;AACA,SAAOuB,GAAG,CAACN,IAAX;AACD","sourcesContent":["/* eslint-disable import/prefer-default-export */\nfunction getScroll(w) {\n var ret = w.pageXOffset;\n var method = 'scrollLeft';\n\n if (typeof ret !== 'number') {\n var d = w.document; // ie6,7,8 standard mode\n\n ret = d.documentElement[method];\n\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n\n return ret;\n}\n\nfunction getClientPosition(elem) {\n var x;\n var y;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n var box = elem.getBoundingClientRect();\n x = box.left;\n y = box.top;\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n return {\n left: x,\n top: y\n };\n}\n\nexport function getOffsetLeft(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument; // Only IE use `parentWindow`\n\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScroll(w);\n return pos.left;\n}"]},"metadata":{},"sourceType":"module"}