Skip to content

Commit

Permalink
...dataset не работает в сафари
Browse files Browse the repository at this point in the history
  • Loading branch information
Katochimoto committed Nov 15, 2016
1 parent a7b466d commit 3f95491
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 56 deletions.
33 changes: 19 additions & 14 deletions dist/x-bubbles-compact.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,23 @@ var XBubbles =

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; };

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; };

var context = __webpack_require__(1);
var drag = __webpack_require__(2);
var editor = __webpack_require__(19);
var bubble = __webpack_require__(5);
var bubbleset = __webpack_require__(7);

var OPTIONS = {
begining: ['noop', null],
bubbleCopy: ['funk', bubbleCopyOption],
bubbleDeformation: ['funk', function () {}],
bubbleFormation: ['funk', function () {}],
checkBubblePaste: ['funk', checkBubblePasteOption],
classBubble: ['noop', 'bubble'],
disableControls: ['bool', false],
draggable: ['bool', true],
ending: ['noop', null], // /\@ya\.ru/g;
separator: ['noop', /[,;]/]
begining: ['noop', null, 'begining'],
bubbleCopy: ['funk', bubbleCopyOption, 'bubble-copy'],
bubbleDeformation: ['funk', function () {}, 'bubble-deformation'],
bubbleFormation: ['funk', function () {}, 'bubble-formation'],
checkBubblePaste: ['funk', checkBubblePasteOption, 'check-bubble-paste'],
classBubble: ['noop', 'bubble', 'class-bubble'],
disableControls: ['bool', false, 'disable-controls'],
draggable: ['bool', true, 'draggable'],
ending: ['noop', null, 'ending'], // /\@ya\.ru/g;
separator: ['noop', /[,;]/, 'separator']
};

var XBubbles = Object.create(HTMLDivElement.prototype, {
Expand Down Expand Up @@ -103,10 +101,17 @@ var XBubbles =
options: {
value: function value(name, _value) {
if (!this._options) {
this._options = _extends({}, Object.keys(OPTIONS).reduce(function (result, item) {
this._options = Object.keys(OPTIONS).reduce(function (result, item) {
result[item] = undefined;
return result;
}, {}), this.dataset);
}, {});

for (var optionName in OPTIONS) {
var attrName = 'data-' + OPTIONS[optionName][2];
if (this.hasAttribute(attrName)) {
this._options[optionName] = this.getAttribute(attrName);
}
}

optionsPrepare(this._options);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/x-bubbles-compact.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/x-bubbles-compact.min.js.map

Large diffs are not rendered by default.

33 changes: 19 additions & 14 deletions dist/x-bubbles.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,23 @@ var XBubbles =

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; };

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; };

var context = __webpack_require__(1);
var drag = __webpack_require__(2);
var editor = __webpack_require__(19);
var bubble = __webpack_require__(5);
var bubbleset = __webpack_require__(7);

var OPTIONS = {
begining: ['noop', null],
bubbleCopy: ['funk', bubbleCopyOption],
bubbleDeformation: ['funk', function () {}],
bubbleFormation: ['funk', function () {}],
checkBubblePaste: ['funk', checkBubblePasteOption],
classBubble: ['noop', 'bubble'],
disableControls: ['bool', false],
draggable: ['bool', true],
ending: ['noop', null], // /\@ya\.ru/g;
separator: ['noop', /[,;]/]
begining: ['noop', null, 'begining'],
bubbleCopy: ['funk', bubbleCopyOption, 'bubble-copy'],
bubbleDeformation: ['funk', function () {}, 'bubble-deformation'],
bubbleFormation: ['funk', function () {}, 'bubble-formation'],
checkBubblePaste: ['funk', checkBubblePasteOption, 'check-bubble-paste'],
classBubble: ['noop', 'bubble', 'class-bubble'],
disableControls: ['bool', false, 'disable-controls'],
draggable: ['bool', true, 'draggable'],
ending: ['noop', null, 'ending'], // /\@ya\.ru/g;
separator: ['noop', /[,;]/, 'separator']
};

var XBubbles = Object.create(HTMLDivElement.prototype, {
Expand Down Expand Up @@ -103,10 +101,17 @@ var XBubbles =
options: {
value: function value(name, _value) {
if (!this._options) {
this._options = _extends({}, Object.keys(OPTIONS).reduce(function (result, item) {
this._options = Object.keys(OPTIONS).reduce(function (result, item) {
result[item] = undefined;
return result;
}, {}), this.dataset);
}, {});

for (var optionName in OPTIONS) {
var attrName = 'data-' + OPTIONS[optionName][2];
if (this.hasAttribute(attrName)) {
this._options[optionName] = this.getAttribute(attrName);
}
}

optionsPrepare(this._options);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/x-bubbles.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/x-bubbles.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/x-bubbles.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/x-bubbles.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "x-bubbles",
"description": "Bubbles",
"version": "0.0.23",
"version": "0.0.24",
"keywords": [],
"homepage": "https://github.com/Katochimoto/x-bubbles",
"author": {
Expand Down
39 changes: 21 additions & 18 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ const bubble = require('./core/bubble');
const bubbleset = require('./core/bubbleset');

const OPTIONS = {
begining: [ 'noop', null ],
bubbleCopy: [ 'funk', bubbleCopyOption ],
bubbleDeformation: [ 'funk', function () {} ],
bubbleFormation: [ 'funk', function () {} ],
checkBubblePaste: [ 'funk', checkBubblePasteOption ],
classBubble: [ 'noop', 'bubble' ],
disableControls: [ 'bool', false ],
draggable: [ 'bool', true ],
ending: [ 'noop', null ], // /\@ya\.ru/g;
separator: [ 'noop', /[,;]/ ],
begining: [ 'noop', null, 'begining' ],
bubbleCopy: [ 'funk', bubbleCopyOption, 'bubble-copy' ],
bubbleDeformation: [ 'funk', function () {}, 'bubble-deformation' ],
bubbleFormation: [ 'funk', function () {}, 'bubble-formation' ],
checkBubblePaste: [ 'funk', checkBubblePasteOption, 'check-bubble-paste' ],
classBubble: [ 'noop', 'bubble', 'class-bubble' ],
disableControls: [ 'bool', false, 'disable-controls' ],
draggable: [ 'bool', true, 'draggable' ],
ending: [ 'noop', null, 'ending' ], // /\@ya\.ru/g;
separator: [ 'noop', /[,;]/, 'separator' ],
};

const XBubbles = Object.create(HTMLDivElement.prototype, {
Expand Down Expand Up @@ -48,14 +48,17 @@ const XBubbles = Object.create(HTMLDivElement.prototype, {
options: {
value: function (name, value) {
if (!this._options) {
this._options = {
...Object.keys(OPTIONS).reduce(function (result, item) {
result[ item ] = undefined;
return result;
}, {}),

...this.dataset
};
this._options = Object.keys(OPTIONS).reduce(function (result, item) {
result[ item ] = undefined;
return result;
}, {});

for (const optionName in OPTIONS) {
const attrName = `data-${OPTIONS[ optionName ][2]}`;
if (this.hasAttribute(attrName)) {
this._options[ optionName ] = this.getAttribute(attrName);
}
}

optionsPrepare(this._options);
}
Expand Down

0 comments on commit 3f95491

Please sign in to comment.