flex-shrink.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. (function() {
  2. var Declaration, FlexShrink, 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. FlexShrink = (function(_super) {
  8. __extends(FlexShrink, _super);
  9. function FlexShrink() {
  10. return FlexShrink.__super__.constructor.apply(this, arguments);
  11. }
  12. FlexShrink.names = ['flex-shrink', 'flex-negative'];
  13. FlexShrink.prototype.normalize = function() {
  14. return 'flex-shrink';
  15. };
  16. FlexShrink.prototype.prefixed = function(prop, prefix) {
  17. var spec, _ref;
  18. _ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
  19. if (spec === 2012) {
  20. return prefix + 'flex-negative';
  21. } else {
  22. return FlexShrink.__super__.prefixed.apply(this, arguments);
  23. }
  24. };
  25. FlexShrink.prototype.set = function(decl, prefix) {
  26. var spec, _ref;
  27. _ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
  28. if (spec === 2012 || spec === 'final') {
  29. return FlexShrink.__super__.set.apply(this, arguments);
  30. }
  31. };
  32. return FlexShrink;
  33. })(Declaration);
  34. module.exports = FlexShrink;
  35. }).call(this);