Fix tests

This commit is contained in:
Paulo Gustavo Veiga 2021-10-02 17:10:21 -07:00
parent 79793820ea
commit 38ec9931d7
2 changed files with 134 additions and 132 deletions

View File

@ -14,8 +14,6 @@
web2d.peer.utils = {}; web2d.peer.utils = {};
</script> </script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function initialize() { function initialize() {
web2d.Toolkit.init(); web2d.Toolkit.init();

View File

@ -1,6 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<script type="text/javascript"> <script type="text/javascript">
web2d = { web2d = {
@ -19,7 +20,6 @@
float: left; float: left;
margin: 10px; margin: 10px;
} }
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
@ -29,10 +29,11 @@
this._element = element; this._element = element;
this._type = type; this._type = type;
this._listener = function logger(event) { this._listener = function logger(event) {
var oldColor = this.getAttribute('fillColor'); var oldColor = element.getAttribute('fillColor');
this.setFill("yellow"); element.setFill("yellow");
alert("Event on:" + this.getType() + ", Type:" + type);
this.setFill(oldColor); alert("Event on:" + element.getType() + ", Type:" + type);
element.setFill(oldColor);
}; };
} }
@ -146,7 +147,8 @@
<tr> <tr>
<td> <td>
This examples shows the ability to attach listeners to handle several events. This examples shows the ability to attach listeners to handle several events.
In this example, you can attach different events to three elements: workspace, small elipse and the big In this example, you can attach different events to three elements: workspace, small elipse and the
big
elipse. elipse.
Events will follow the event bubbling behaviour. Events will follow the event bubbling behaviour.
</td> </td>
@ -239,7 +241,8 @@
</tr> </tr>
<tr> <tr>
<td>Multiple listeners can be attached to an element to handle an event type. <td>Multiple listeners can be attached to an element to handle an event type.
In this example, multiple listeners can be registered to the elipse element to handle the click event type. In this example, multiple listeners can be registered to the elipse element to handle the click
event type.
</td> </td>
<td> <td>
<div id="workspaceMultipleEvents" style="float:left;"></div> <div id="workspaceMultipleEvents" style="float:left;"></div>
@ -267,4 +270,5 @@
</tbody> </tbody>
</table> </table>
</body> </body>
</html> </html>