Skip to content

Commit

Permalink
Add spec for hasFocus alias and fix implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveSanderson committed Nov 23, 2012
1 parent 276e3a8 commit b8604bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/defaultBindings/hasfocusBehaviors.js
Expand Up @@ -57,4 +57,8 @@ describe('Binding: Hasfocus', function() {
ko.utils.triggerEvent(testNode.childNodes[0], "focusout");
expect(model.myVal).toEqual(false);
});

it('Should be aliased as hasFocus as well as hasfocus', function() {
expect(ko.bindingHandlers.hasFocus).toEqual(ko.bindingHandlers.hasfocus);
});
});
2 changes: 1 addition & 1 deletion src/binding/defaultBindings/hasfocus.js
Expand Up @@ -34,4 +34,4 @@ ko.bindingHandlers['hasfocus'] = {
}
};

ko.exportSymbol('hasFocus', ko.bindingHandlers.hasfocus); //Make "hasFocus" an alias
ko.exportSymbol('bindingHandlers.hasFocus', ko.bindingHandlers.hasfocus); // Make "hasFocus" an alias

0 comments on commit b8604bd

Please sign in to comment.