Skip to content

Commit

Permalink
hasFocus fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sv01a committed Nov 3, 2012
1 parent 91b8a9c commit 0818bcf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,9 @@ ko.extenders['logChange'] = (target, option)=>{
return target;
};

ko.bindingHandlers.hasFocus = {
ko.bindingHandlers['hasFocus'] = {
init: (element, valueAccessor)=>{
$(element).focus(function() {
var value = valueAccessor();
value(true);
});
$(element).blur(function() {
var value = valueAccessor();
value(false);
});

},
update: function(element, valueAccessor) {
var value = valueAccessor();
Expand Down

0 comments on commit 0818bcf

Please sign in to comment.