Sha256: a702b121ceac9ed692bd932d9c60b7618783afeedb5863f4b32504ebe4848a7d

Contents?: true

Size: 1.21 KB

Versions: 39

Compression:

Stored size: 1.21 KB

Contents

/*!
 * getStyleProperty v1.0.4
 * original by kangax
 * http://perfectionkills.com/feature-testing-css-properties/
 * MIT license
 */

/*jshint browser: true, strict: true, undef: true */
/*global define: false, exports: false, module: false */

( function( window ) {

'use strict';

var prefixes = 'Webkit Moz ms Ms O'.split(' ');
var docElemStyle = document.documentElement.style;

function getStyleProperty( propName ) {
  if ( !propName ) {
    return;
  }

  // test standard property first
  if ( typeof docElemStyle[ propName ] === 'string' ) {
    return propName;
  }

  // capitalize
  propName = propName.charAt(0).toUpperCase() + propName.slice(1);

  // test vendor specific properties
  var prefixed;
  for ( var i=0, len = prefixes.length; i < len; i++ ) {
    prefixed = prefixes[i] + propName;
    if ( typeof docElemStyle[ prefixed ] === 'string' ) {
      return prefixed;
    }
  }
}

// transport
if ( typeof define === 'function' && define.amd ) {
  // AMD
  define( function() {
    return getStyleProperty;
  });
} else if ( typeof exports === 'object' ) {
  // CommonJS for Component
  module.exports = getStyleProperty;
} else {
  // browser global
  window.getStyleProperty = getStyleProperty;
}

})( window );

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
wbase-0.3.20 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.19 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.18 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.17 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.16 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.15 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.14 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.13 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.12 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.11 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.10 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.9 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.8 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.7 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.6 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.5 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.4 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.3 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.2 lib/vendor/admin/get-style-property/get-style-property.js
wbase-0.3.1 lib/vendor/admin/get-style-property/get-style-property.js