1 | "use strict";
|
---|
2 |
|
---|
3 | 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; }
|
---|
4 |
|
---|
5 | function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
---|
6 |
|
---|
7 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
---|
8 |
|
---|
9 | var Declaration = require('../declaration');
|
---|
10 |
|
---|
11 | var OverscrollBehavior = /*#__PURE__*/function (_Declaration) {
|
---|
12 | _inheritsLoose(OverscrollBehavior, _Declaration);
|
---|
13 |
|
---|
14 | function OverscrollBehavior() {
|
---|
15 | return _Declaration.apply(this, arguments) || this;
|
---|
16 | }
|
---|
17 |
|
---|
18 | var _proto = OverscrollBehavior.prototype;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Change property name for IE
|
---|
22 | */
|
---|
23 | _proto.prefixed = function prefixed(prop, prefix) {
|
---|
24 | return prefix + 'scroll-chaining';
|
---|
25 | }
|
---|
26 | /**
|
---|
27 | * Return property name by spec
|
---|
28 | */
|
---|
29 | ;
|
---|
30 |
|
---|
31 | _proto.normalize = function normalize() {
|
---|
32 | return 'overscroll-behavior';
|
---|
33 | }
|
---|
34 | /**
|
---|
35 | * Change value for IE
|
---|
36 | */
|
---|
37 | ;
|
---|
38 |
|
---|
39 | _proto.set = function set(decl, prefix) {
|
---|
40 | if (decl.value === 'auto') {
|
---|
41 | decl.value = 'chained';
|
---|
42 | } else if (decl.value === 'none' || decl.value === 'contain') {
|
---|
43 | decl.value = 'none';
|
---|
44 | }
|
---|
45 |
|
---|
46 | return _Declaration.prototype.set.call(this, decl, prefix);
|
---|
47 | };
|
---|
48 |
|
---|
49 | return OverscrollBehavior;
|
---|
50 | }(Declaration);
|
---|
51 |
|
---|
52 | _defineProperty(OverscrollBehavior, "names", ['overscroll-behavior', 'scroll-chaining']);
|
---|
53 |
|
---|
54 | module.exports = OverscrollBehavior; |
---|