source: frontend/node_modules/underscore/amd/bindAll.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 632 bytes
Line 
1define(['./restArguments', './_flatten', './bind'], function (restArguments, _flatten, bind) {
2
3 // Bind a number of an object's methods to that object. Remaining arguments
4 // are the method names to be bound. Useful for ensuring that all callbacks
5 // defined on an object belong to it.
6 var bindAll = restArguments(function(obj, keys) {
7 keys = _flatten(keys, false, false);
8 var index = keys.length;
9 if (index < 1) throw new Error('bindAll must be passed function names');
10 while (index--) {
11 var key = keys[index];
12 obj[key] = bind(obj[key], obj);
13 }
14 return obj;
15 });
16
17 return bindAll;
18
19});
Note: See TracBrowser for help on using the repository browser.