[model][xs]: tweak to _backendFromString to remove option to look up backends specified as full module pathes as this is a liable to bugs and it is not being used.

This commit is contained in:
Rufus Pollock
2012-09-18 22:57:44 +01:00
parent ce668a32c7
commit d5f0b074c2
4 changed files with 8 additions and 47 deletions

View File

@@ -262,22 +262,8 @@ my.Dataset = Backbone.Model.extend({
// ### _backendFromString(backendString)
//
// See backend argument to initialize for details
// Look up a backend module from a backend string (look in recline.Backend)
_backendFromString: function(backendString) {
var parts = backendString.split('.');
// walk through the specified path xxx.yyy.zzz to get the final object which should be backend class
var current = window;
for(ii=0;ii<parts.length;ii++) {
if (!current) {
break;
}
current = current[parts[ii]];
}
if (current) {
return current;
}
// alternatively we just had a simple string
var backend = null;
if (recline && recline.Backend) {
_.each(_.keys(recline.Backend), function(name) {