flex-grow.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. (function() {
  2. var Declaration, Flex, flexSpec,
  3. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4. __hasProp = {}.hasOwnProperty;
  5. flexSpec = require('./flex-spec');
  6. Declaration = require('../declaration');
  7. Flex = (function(_super) {
  8. __extends(Flex, _super);
  9. function Flex() {
  10. return Flex.__super__.constructor.apply(this, arguments);
  11. }
  12. Flex.names = ['flex-grow', 'flex-positive'];
  13. Flex.prototype.normalize = function() {
  14. return 'flex';
  15. };
  16. Flex.prototype.prefixed = function(prop, prefix) {
  17. var spec, _ref;
  18. _ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
  19. if (spec === 2009) {
  20. return prefix + 'box-flex';
  21. } else if (spec === 2012) {
  22. return prefix + 'flex-positive';
  23. } else {
  24. return Flex.__super__.prefixed.apply(this, arguments);
  25. }
  26. };
  27. return Flex;
  28. })(Declaration);
  29. module.exports = Flex;
  30. }).call(this);