Browse Source

Fixes issue #807

Puts jQuery.allowJavaScriptCalls in HTMLCanvas class >> initialize.
Nicolas Petton 10 years ago
parent
commit
483d5de51c
3 changed files with 25 additions and 4 deletions
  1. 16 0
      js/Canvas.js
  2. 9 0
      st/Canvas.st
  3. 0 4
      support/boot.js

+ 16 - 0
js/Canvas.js

@@ -2180,6 +2180,22 @@ referencedClasses: []
 smalltalk.HTMLCanvas);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(jQuery)._basicAt_put_("allowJavaScriptCalls",true);
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HTMLCanvas.klass)})},
+args: [],
+source: "initialize\x0a\x09\x22Allow JS method calls for the jQuery object.\x0a\x09See boot.js DNU handling.\x22\x0a\x09\x0a\x09jQuery basicAt: 'allowJavaScriptCalls' put: true",
+messageSends: ["basicAt:put:"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onJQuery:",

+ 9 - 0
st/Canvas.st

@@ -545,6 +545,15 @@ video
 	^ self tag: 'video'
 ! !
 
+!HTMLCanvas class methodsFor: 'initialization'!
+
+initialize
+	"Allow JS method calls for the jQuery object.
+	See boot.js DNU handling."
+	
+	jQuery basicAt: 'allowJavaScriptCalls' put: true
+! !
+
 !HTMLCanvas class methodsFor: 'instance creation'!
 
 onJQuery: aJQuery

+ 0 - 4
support/boot.js

@@ -1032,10 +1032,6 @@ function MessageSendBrik(brikz, st) {
 		return st.send(st.JSObjectProxy._on_(receiver), selector, args);
 	}
 
-	if(typeof jQuery !== "undefined") {
-		jQuery.allowJavaScriptCalls = true;
-	}
-
 	this.messageNotUnderstood = messageNotUnderstood;
 }