fe5297ea by Adam Heath

In rivetsBinderCall, allow for binders that are pure functions(which

means they only implement routine()).

Refs: #7680
1 parent 02861f93
...@@ -2,12 +2,20 @@ define(function(require) { ...@@ -2,12 +2,20 @@ define(function(require) {
2 'use strict'; 2 'use strict';
3 var module = require('module'); 3 var module = require('module');
4 var rivets = require('rivets'); 4 var rivets = require('rivets');
5 var _ = require('underscore');
5 var Backbone = require('backbone'); 6 var Backbone = require('backbone');
6 var $ = require('jquery'); 7 var $ = require('jquery');
7 8
8 var rivetsBinderCall = function(binding, binderName, methodName, args) { 9 var rivetsBinderCall = function(binding, binderName, methodName, args) {
9 var binder = rivets.binders[binderName]; 10 var binder = rivets.binders[binderName];
10 binder[methodName].apply(binding, args); 11 var method = binder[methodName];
12 if (_.isFunction(binder)) {
13 if (methodName === 'routine') {
14 binder.apply(binding, args);
15 }
16 } else {
17 binder[methodName].apply(binding, args);
18 }
11 }; 19 };
12 20
13 var render = function(el, cmd, errorList) { 21 var render = function(el, cmd, errorList) {
......