Forum > Pas2JS

aEvent.currentTarget.ID error in pas2js trunk & Lazarus 2.1.0 [solved]

(1/1)

Bazic:

I tried to run tetris using last trunk version of pas2js & Lazarus 2.1.0 but still with error in utetris.pp, in onClick event handler:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function TTetris.DoMouseClick(aEvent: TJSMouseEvent): boolean;
error is located in line 630:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  S:=aEvent.currentTarget.ID;
it needs to be corrected this way:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  S:=aEvent.currentTargetElement.id;

PascalDragon:

--- Quote from: Bazic on November 15, 2020, 11:26:49 am ---I tried to run tetris using last trunk version of pas2js & Lazarus 2.1.0 but still with error in utetris.pp, in onClick event handler:
--- End quote ---

Fixed. Please report such things at the bugtracker in the future (especially as one of the main devs only reads the forum when notified).

kwer:
pas2js/demo/pacman/upacman.pp (Line:763)
 S:=aEvent.currentTargetElement.id;  //currentTarget.ID;

Navigation

[0] Message Index

Go to full version