Browse Source

Bind event handlers without jQuery.

Herby Vojčík 4 years ago
parent
commit
42bbc548d9
2 changed files with 4 additions and 4 deletions
  1. 3 3
      src/Web.js
  2. 1 1
      src/Web.st

+ 3 - 3
src/Web.js

@@ -3650,7 +3650,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv($self._asJQuery())._bind_do_(aString,aBlock);
+$recv($self._asDomNode())._addEventListener_block_useCapture_(aString,aBlock,false);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"onEvent:do:",{aString:aString,aBlock:aBlock})});
@@ -3658,11 +3658,11 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString", "aBlock"],
-source: "onEvent: aString do: aBlock\x0a\x09self asJQuery bind: aString do: aBlock",
+source: "onEvent: aString do: aBlock\x0a\x09self asDomNode addEventListener: aString block: aBlock useCapture: false",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["bind:do:", "asJQuery"]
+messageSends: ["addEventListener:block:useCapture:", "asDomNode"]
 }),
 $globals.TagBrush);
 

+ 1 - 1
src/Web.st

@@ -731,7 +731,7 @@ onDblClick: aBlock
 !
 
 onEvent: aString do: aBlock
-	self asJQuery bind: aString do: aBlock
+	self asDomNode addEventListener: aString block: aBlock useCapture: false
 !
 
 onFocus: aBlock