Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Updated jquery.concrete

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92538 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 241bff3df934727055fdd8579ce5c3f611d68742 1 parent f60e94b
@chillu chillu authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 thirdparty/jquery-concrete/jquery.concrete.js
View
12 thirdparty/jquery-concrete/jquery.concrete.js
@@ -106,13 +106,11 @@ var console;
namespaces[name] = this;
var self = this;
-
this.$ = function() {
var jq = $.apply(window, arguments);
jq.namespace = self;
return jq;
}
- $.extend(this.$, $);
},
/**
@@ -163,7 +161,15 @@ var console;
build_jquery_injection: function(name) {
if (!$.fn[name]) {
$.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;
return namespace.proxies[name].apply(this, arguments);
}
Please sign in to comment.
Something went wrong with that request. Please try again.