MCPcopy Create free account
hub / github.com/TruthHun/DocHub / getElementStyles

Function getElementStyles

static/Home/default/js/flat-ui.js:3303–3328  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

3301});
3302
3303function getElementStyles( elem ) {
3304 var key, len,
3305 style = elem.ownerDocument.defaultView ?
3306 elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
3307 elem.currentStyle,
3308 styles = {};
3309
3310 if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
3311 len = style.length;
3312 while ( len-- ) {
3313 key = style[ len ];
3314 if ( typeof style[ key ] === "string" ) {
3315 styles[ $.camelCase( key ) ] = style[ key ];
3316 }
3317 }
3318 // support: Opera, IE <9
3319 } else {
3320 for ( key in style ) {
3321 if ( typeof style[ key ] === "string" ) {
3322 styles[ key ] = style[ key ];
3323 }
3324 }
3325 }
3326
3327 return styles;
3328}
3329
3330
3331function styleDifference( oldStyle, newStyle ) {

Callers 1

flat-ui.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected