dresscode-botex
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -75,2 +75,11 @@ Botex.MutableArray = Bricks.inherit(Bricks.Observer, { | ||
filter: function(callback, ctx) { | ||
for (var i = 0; i < this._value.length; i++) { | ||
if (!callback.call(ctx, this._value[i])) { | ||
this.splice(i, 1); | ||
i--; | ||
} | ||
} | ||
}, | ||
transform: function(callback, ctx) { | ||
@@ -77,0 +86,0 @@ var dependent = new Botex.MutableArray(); |
{ | ||
"name": "dresscode-botex", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "dresscode-bricks": "latest", |
@@ -23,2 +23,9 @@ new Samples.HelloWorld({ | ||
}); | ||
Bricks.DOM.on(document, 'keydown', function(evt) { | ||
if (evt.keyCode === 83) { | ||
arr.filter(function(num) { | ||
return num % 2; | ||
}) | ||
} | ||
}) | ||
@@ -25,0 +32,0 @@ |
@@ -8,14 +8,17 @@ Samples.MutableArray = Bricks.inherit(Botex.Widget, { | ||
return { | ||
content: $.value.transform(function(item) { | ||
if (item % 2) { | ||
return new Botex.Widget({ | ||
tagName: 'b', | ||
content: item | ||
}); | ||
} else { | ||
return Botex.zen('i', item); | ||
} | ||
}, this) | ||
content: [ | ||
'Нажмите s, чтобы убрать чётные числа', | ||
$.value.transform(function(item) { | ||
if (item % 2) { | ||
return new Botex.Widget({ | ||
tagName: 'b', | ||
content: [' ', item] | ||
}); | ||
} else { | ||
return Botex.zen('i', [' ', item]); | ||
} | ||
}, this) | ||
] | ||
}; | ||
} | ||
}); |
49524
1336