Skip to content

Commit 3f95491

Browse files
author
Katochimoto
committed
...dataset не работает в сафари
1 parent a7b466d commit 3f95491

10 files changed

Lines changed: 69 additions & 56 deletions

dist/x-bubbles-compact.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,23 @@ var XBubbles =
5151

5252
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
5353

54-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
55-
5654
var context = __webpack_require__(1);
5755
var drag = __webpack_require__(2);
5856
var editor = __webpack_require__(19);
5957
var bubble = __webpack_require__(5);
6058
var bubbleset = __webpack_require__(7);
6159

6260
var OPTIONS = {
63-
begining: ['noop', null],
64-
bubbleCopy: ['funk', bubbleCopyOption],
65-
bubbleDeformation: ['funk', function () {}],
66-
bubbleFormation: ['funk', function () {}],
67-
checkBubblePaste: ['funk', checkBubblePasteOption],
68-
classBubble: ['noop', 'bubble'],
69-
disableControls: ['bool', false],
70-
draggable: ['bool', true],
71-
ending: ['noop', null], // /\@ya\.ru/g;
72-
separator: ['noop', /[,;]/]
61+
begining: ['noop', null, 'begining'],
62+
bubbleCopy: ['funk', bubbleCopyOption, 'bubble-copy'],
63+
bubbleDeformation: ['funk', function () {}, 'bubble-deformation'],
64+
bubbleFormation: ['funk', function () {}, 'bubble-formation'],
65+
checkBubblePaste: ['funk', checkBubblePasteOption, 'check-bubble-paste'],
66+
classBubble: ['noop', 'bubble', 'class-bubble'],
67+
disableControls: ['bool', false, 'disable-controls'],
68+
draggable: ['bool', true, 'draggable'],
69+
ending: ['noop', null, 'ending'], // /\@ya\.ru/g;
70+
separator: ['noop', /[,;]/, 'separator']
7371
};
7472

7573
var XBubbles = Object.create(HTMLDivElement.prototype, {
@@ -103,10 +101,17 @@ var XBubbles =
103101
options: {
104102
value: function value(name, _value) {
105103
if (!this._options) {
106-
this._options = _extends({}, Object.keys(OPTIONS).reduce(function (result, item) {
104+
this._options = Object.keys(OPTIONS).reduce(function (result, item) {
107105
result[item] = undefined;
108106
return result;
109-
}, {}), this.dataset);
107+
}, {});
108+
109+
for (var optionName in OPTIONS) {
110+
var attrName = 'data-' + OPTIONS[optionName][2];
111+
if (this.hasAttribute(attrName)) {
112+
this._options[optionName] = this.getAttribute(attrName);
113+
}
114+
}
110115

111116
optionsPrepare(this._options);
112117
}

dist/x-bubbles-compact.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/x-bubbles-compact.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/x-bubbles.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,23 @@ var XBubbles =
5151

5252
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
5353

54-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
55-
5654
var context = __webpack_require__(1);
5755
var drag = __webpack_require__(2);
5856
var editor = __webpack_require__(19);
5957
var bubble = __webpack_require__(5);
6058
var bubbleset = __webpack_require__(7);
6159

6260
var OPTIONS = {
63-
begining: ['noop', null],
64-
bubbleCopy: ['funk', bubbleCopyOption],
65-
bubbleDeformation: ['funk', function () {}],
66-
bubbleFormation: ['funk', function () {}],
67-
checkBubblePaste: ['funk', checkBubblePasteOption],
68-
classBubble: ['noop', 'bubble'],
69-
disableControls: ['bool', false],
70-
draggable: ['bool', true],
71-
ending: ['noop', null], // /\@ya\.ru/g;
72-
separator: ['noop', /[,;]/]
61+
begining: ['noop', null, 'begining'],
62+
bubbleCopy: ['funk', bubbleCopyOption, 'bubble-copy'],
63+
bubbleDeformation: ['funk', function () {}, 'bubble-deformation'],
64+
bubbleFormation: ['funk', function () {}, 'bubble-formation'],
65+
checkBubblePaste: ['funk', checkBubblePasteOption, 'check-bubble-paste'],
66+
classBubble: ['noop', 'bubble', 'class-bubble'],
67+
disableControls: ['bool', false, 'disable-controls'],
68+
draggable: ['bool', true, 'draggable'],
69+
ending: ['noop', null, 'ending'], // /\@ya\.ru/g;
70+
separator: ['noop', /[,;]/, 'separator']
7371
};
7472

7573
var XBubbles = Object.create(HTMLDivElement.prototype, {
@@ -103,10 +101,17 @@ var XBubbles =
103101
options: {
104102
value: function value(name, _value) {
105103
if (!this._options) {
106-
this._options = _extends({}, Object.keys(OPTIONS).reduce(function (result, item) {
104+
this._options = Object.keys(OPTIONS).reduce(function (result, item) {
107105
result[item] = undefined;
108106
return result;
109-
}, {}), this.dataset);
107+
}, {});
108+
109+
for (var optionName in OPTIONS) {
110+
var attrName = 'data-' + OPTIONS[optionName][2];
111+
if (this.hasAttribute(attrName)) {
112+
this._options[optionName] = this.getAttribute(attrName);
113+
}
114+
}
110115

111116
optionsPrepare(this._options);
112117
}

dist/x-bubbles.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/x-bubbles.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/x-bubbles.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/x-bubbles.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "x-bubbles",
33
"description": "Bubbles",
4-
"version": "0.0.23",
4+
"version": "0.0.24",
55
"keywords": [],
66
"homepage": "https://github.com/Katochimoto/x-bubbles",
77
"author": {

src/index.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ const bubble = require('./core/bubble');
55
const bubbleset = require('./core/bubbleset');
66

77
const OPTIONS = {
8-
begining: [ 'noop', null ],
9-
bubbleCopy: [ 'funk', bubbleCopyOption ],
10-
bubbleDeformation: [ 'funk', function () {} ],
11-
bubbleFormation: [ 'funk', function () {} ],
12-
checkBubblePaste: [ 'funk', checkBubblePasteOption ],
13-
classBubble: [ 'noop', 'bubble' ],
14-
disableControls: [ 'bool', false ],
15-
draggable: [ 'bool', true ],
16-
ending: [ 'noop', null ], // /\@ya\.ru/g;
17-
separator: [ 'noop', /[,;]/ ],
8+
begining: [ 'noop', null, 'begining' ],
9+
bubbleCopy: [ 'funk', bubbleCopyOption, 'bubble-copy' ],
10+
bubbleDeformation: [ 'funk', function () {}, 'bubble-deformation' ],
11+
bubbleFormation: [ 'funk', function () {}, 'bubble-formation' ],
12+
checkBubblePaste: [ 'funk', checkBubblePasteOption, 'check-bubble-paste' ],
13+
classBubble: [ 'noop', 'bubble', 'class-bubble' ],
14+
disableControls: [ 'bool', false, 'disable-controls' ],
15+
draggable: [ 'bool', true, 'draggable' ],
16+
ending: [ 'noop', null, 'ending' ], // /\@ya\.ru/g;
17+
separator: [ 'noop', /[,;]/, 'separator' ],
1818
};
1919

2020
const XBubbles = Object.create(HTMLDivElement.prototype, {
@@ -48,14 +48,17 @@ const XBubbles = Object.create(HTMLDivElement.prototype, {
4848
options: {
4949
value: function (name, value) {
5050
if (!this._options) {
51-
this._options = {
52-
...Object.keys(OPTIONS).reduce(function (result, item) {
53-
result[ item ] = undefined;
54-
return result;
55-
}, {}),
56-
57-
...this.dataset
58-
};
51+
this._options = Object.keys(OPTIONS).reduce(function (result, item) {
52+
result[ item ] = undefined;
53+
return result;
54+
}, {});
55+
56+
for (const optionName in OPTIONS) {
57+
const attrName = `data-${OPTIONS[ optionName ][2]}`;
58+
if (this.hasAttribute(attrName)) {
59+
this._options[ optionName ] = this.getAttribute(attrName);
60+
}
61+
}
5962

6063
optionsPrepare(this._options);
6164
}

0 commit comments

Comments
 (0)