dresscode-botex
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -154,3 +154,3 @@ Botex.Widget = Bricks.inherit(Botex.Tag, { | ||
if (typeof name === 'string') { | ||
events.split(/\s*,\s*/).forEach(function(event) { | ||
this._splitEventNames(events).forEach(function(event) { | ||
this._elemListeners.push([name, event, fn, new Botex.ElemsObserver({ | ||
@@ -186,3 +186,3 @@ store: this._elemsStore, | ||
if (typeof name === 'string') { | ||
events.split(/\s*,\s*/).forEach(function(event) { | ||
this._splitEventNames(events).forEach(function(event) { | ||
for (var i = 0; i < this._elemListeners.length; i++) { | ||
@@ -202,2 +202,17 @@ var item = this._elemListeners[i]; | ||
_splitEventNames: function(events) { | ||
var result = []; | ||
if (!Pony.Array.isArray(events)) { | ||
events = [events]; | ||
} | ||
events.forEach(function(event) { | ||
if (typeof event === 'string') { | ||
[].push.apply(result, event.split(/\s*,\s*/)); | ||
} else { | ||
result.push(event); | ||
} | ||
}, this); | ||
return result; | ||
}, | ||
_createElement: function(meta, container, beforeEl) { | ||
@@ -204,0 +219,0 @@ var el = this._doc.createElement(meta.tagName); |
{ | ||
"name": "dresscode-botex", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "dresscode-bricks": "latest", |
42637
1134