b2b9b63c5f81c4fff8840db77d9ac9f7.json
2.57 KB
{"ast":null,"code":"/**\n * Easy to set element style, return previous style\n * IE browser compatible(IE browser doesn't merge overflow style, need to set it separately)\n * https://github.com/ant-design/ant-design/issues/19393\n *\n */\nfunction setStyle(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$element = options.element,\n element = _options$element === void 0 ? document.body : _options$element;\n var oldStyle = {};\n var styleKeys = Object.keys(style); // IE browser compatible\n\n styleKeys.forEach(function (key) {\n oldStyle[key] = element.style[key];\n });\n styleKeys.forEach(function (key) {\n element.style[key] = style[key];\n });\n return oldStyle;\n}\n\nexport default setStyle;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-util/es/setStyle.js"],"names":["setStyle","style","options","arguments","length","undefined","_options$element","element","document","body","oldStyle","styleKeys","Object","keys","forEach","key"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,MAAIC,OAAO,GAAGC,SAAS,CAACC,MAAV,GAAmB,CAAnB,IAAwBD,SAAS,CAAC,CAAD,CAAT,KAAiBE,SAAzC,GAAqDF,SAAS,CAAC,CAAD,CAA9D,GAAoE,EAAlF;AACA,MAAIG,gBAAgB,GAAGJ,OAAO,CAACK,OAA/B;AAAA,MACIA,OAAO,GAAGD,gBAAgB,KAAK,KAAK,CAA1B,GAA8BE,QAAQ,CAACC,IAAvC,GAA8CH,gBAD5D;AAEA,MAAII,QAAQ,GAAG,EAAf;AACA,MAAIC,SAAS,GAAGC,MAAM,CAACC,IAAP,CAAYZ,KAAZ,CAAhB,CALuB,CAKa;;AAEpCU,EAAAA,SAAS,CAACG,OAAV,CAAkB,UAAUC,GAAV,EAAe;AAC/BL,IAAAA,QAAQ,CAACK,GAAD,CAAR,GAAgBR,OAAO,CAACN,KAAR,CAAcc,GAAd,CAAhB;AACD,GAFD;AAGAJ,EAAAA,SAAS,CAACG,OAAV,CAAkB,UAAUC,GAAV,EAAe;AAC/BR,IAAAA,OAAO,CAACN,KAAR,CAAcc,GAAd,IAAqBd,KAAK,CAACc,GAAD,CAA1B;AACD,GAFD;AAGA,SAAOL,QAAP;AACD;;AAED,eAAeV,QAAf","sourcesContent":["/**\n * Easy to set element style, return previous style\n * IE browser compatible(IE browser doesn't merge overflow style, need to set it separately)\n * https://github.com/ant-design/ant-design/issues/19393\n *\n */\nfunction setStyle(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$element = options.element,\n element = _options$element === void 0 ? document.body : _options$element;\n var oldStyle = {};\n var styleKeys = Object.keys(style); // IE browser compatible\n\n styleKeys.forEach(function (key) {\n oldStyle[key] = element.style[key];\n });\n styleKeys.forEach(function (key) {\n element.style[key] = style[key];\n });\n return oldStyle;\n}\n\nexport default setStyle;"]},"metadata":{},"sourceType":"module"}