No Description

flex-shrink.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. (function() {
  2. var Declaration, FlexShrink, flexSpec,
  3. extend = 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(superClass) {
  8. extend(FlexShrink, superClass);
  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 ref, spec;
  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 ref, spec;
  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);