Skip to content

Commit

Permalink
MINOR Updated jquery.concrete
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92538 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 21, 2009
1 parent f60e94b commit 241bff3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions thirdparty/jquery-concrete/jquery.concrete.js
Expand Up @@ -106,13 +106,11 @@ var console;
namespaces[name] = this; namespaces[name] = this;


var self = this; var self = this;

this.$ = function() { this.$ = function() {
var jq = $.apply(window, arguments); var jq = $.apply(window, arguments);
jq.namespace = self; jq.namespace = self;
return jq; return jq;
} }
$.extend(this.$, $);
}, },


/** /**
Expand Down Expand Up @@ -163,7 +161,15 @@ var console;
build_jquery_injection: function(name) { build_jquery_injection: function(name) {
if (!$.fn[name]) { if (!$.fn[name]) {
$.fn[name] = function() { $.fn[name] = function() {
var namespace = (this.namespace && this.namespace.proxies[name]) ? this.namespace : namespaces.__base; // Try bound namespace
var namespace = this.namespace;
// If that doesn't exist, or doesn't have function, try root namespace
if (!namespace || !namespace.proxies[name]) namespace = namespaces.__base;
// If that doesn't exist, throw error
if (!namespace.proxies[name]) {
throw new ReferenceError('Concrete function '+name+' not found in ' + (this.namespace ? ('namespace '+this.namespace.name+' or root namespace') : 'root namespace'));
}

namespace.__context = null; namespace.__context = null;
return namespace.proxies[name].apply(this, arguments); return namespace.proxies[name].apply(this, arguments);
} }
Expand Down

0 comments on commit 241bff3

Please sign in to comment.