Display.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Generated by CoffeeScript 1.9.3
  2. var Display, _Declaration,
  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. indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
  6. _Declaration = require('./_Declaration');
  7. module.exports = Display = (function(superClass) {
  8. var self;
  9. extend(Display, superClass);
  10. function Display() {
  11. return Display.__super__.constructor.apply(this, arguments);
  12. }
  13. self = Display;
  14. Display._allowed = ['inline', 'block', 'none'];
  15. Display.prototype._set = function(val) {
  16. val = String(val).toLowerCase();
  17. if (indexOf.call(self._allowed, val) < 0) {
  18. throw Error("Unrecognizable value `" + val + "` for `" + this.prop + "`");
  19. }
  20. return this.val = val;
  21. };
  22. return Display;
  23. })(_Declaration);