a lot of changes

This commit is contained in:
Borys Levytskyi
2015-04-03 00:20:00 +03:00
parent c200a2d507
commit e1963fb09c
11 changed files with 246 additions and 231 deletions

View File

@@ -72,6 +72,24 @@
};
bindr.bindControllers = function (rootViewElement, controllers) {
var elements = rootViewElement.querySelectorAll('[data-controller]'),
i = 0, l = elements.length, name, ctrl;
for(;i<l;i++){
name = elements[i].getAttribute('data-controller');
ctrl = controllers[name];
if(ctrl == null) {
console.warn(nam + ' controller wasn\'t found');
continue;
}
ctrl.bindView(elements[i]);
console.log(name + ' Controller: view bound');
}
}
function bindInput(model, intput, propertyName) {
intput.addEventListener('keyup', function(e){
model[propertyName] = e.srcElement.value;

View File

@@ -9,6 +9,7 @@
}
Command.prototype.execute = function (cmdArgs) {
cmdArgs = cmdArgs || {};
cmdArgs.commandHandled = false;
for(var i=0; i<this.executionHandlers.length; i++) {