fullscreen.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
  3. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
  6. var Selector = require('../selector');
  7. var Fullscreen = function (_Selector) {
  8. _inherits(Fullscreen, _Selector);
  9. function Fullscreen() {
  10. _classCallCheck(this, Fullscreen);
  11. return _possibleConstructorReturn(this, _Selector.apply(this, arguments));
  12. }
  13. /**
  14. * Return different selectors depend on prefix
  15. */
  16. Fullscreen.prototype.prefixed = function prefixed(prefix) {
  17. if (prefix === '-webkit-') {
  18. return ':-webkit-full-screen';
  19. } else if (prefix === '-moz-') {
  20. return ':-moz-full-screen';
  21. } else {
  22. return ':' + prefix + 'fullscreen';
  23. }
  24. };
  25. return Fullscreen;
  26. }(Selector);
  27. Object.defineProperty(Fullscreen, 'names', {
  28. enumerable: true,
  29. writable: true,
  30. value: [':fullscreen']
  31. });
  32. module.exports = Fullscreen;