Browse Source

Force all sandboxes to have fragment.

Nathaniel van Diepen 10 years ago
parent
commit
e578f30fdb
1 changed files with 6 additions and 4 deletions
  1. 6 4
      app/www/js/omnomirc.js

+ 6 - 4
app/www/js/omnomirc.js

@@ -318,10 +318,7 @@
 		pluginSandbox = {
 			$: window.jQuery,
 			jQuery: window.jQuery,
-			$o: $o,
-			fragment: function(){
-				return document.createDocumentFragment();
-			}
+			$o: $o
 		},
 		currentPlugin = 0,
 		Sandbox = function(sandbox){
@@ -333,6 +330,11 @@
 			for(i in sandbox){
 				o[i] = sandbox[i];
 			}
+			if(!exists(o.fragment)){
+				o.fragment = function(){
+					return document.createDocumentFragment();
+				};
+			}
 			return o;
 		},
 		runHook = function(name,args){