Skip to content

Commit

Permalink
Added support for passing boolean values to ko.bindingHandlers.activity
Browse files Browse the repository at this point in the history
Added support for passing boolean values to ko.bindingHandlers.activity; previously only supported functions.
  • Loading branch information
tim-bellette committed Aug 5, 2013
1 parent be71a10 commit a099fdf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions knockout.activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
})(jQuery);


// By: Hans Fjällemark and John Papa
// By: Hans Fj�llemark and John Papa
// https://github.com/CodeSeven/KoLite

;(function($) {
Expand Down Expand Up @@ -374,8 +374,9 @@
},

update: function (element, valueAccessor) {
var activity = valueAccessor()();
var value = ko.utils.unwrapObservable(valueAccessor());
var activity = $.isFunction(value) ? value() : value;
typeof activity !== 'boolean' || $(element).activityEx(activity);
}
};
})(jQuery, ko);
})(jQuery, ko);

0 comments on commit a099fdf

Please sign in to comment.