Skip to content

Commit 435d6ab

Browse files
hansonrhansonr
authored andcommitted
fixes stray "offsets undefined" in j2sApplet.js
1 parent 7e3e3f3 commit 435d6ab

File tree

7 files changed

+16
-4
lines changed

7 files changed

+16
-4
lines changed
289 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190205203840
1+
20190206084542
289 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190205203840
1+
20190206084542
289 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/js/j2sApplet.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// j2sApplet.js BH = Bob Hanson hansonr@stolaf.edu
22

3-
// J2S._version set to "3.2.4.07" 1/4/2019
3+
// J2S._version set to "3.2.4.07" 2019.01.04; 2019.02.06
44

5+
// BH 2/6/2019 adds check for non-DOM event handler in getXY
56
// BH 1/4/2019 moves window.thisApplet to J2S.thisApplet;
67

78
// see devnotes.txt for previous changes.
@@ -1880,6 +1881,11 @@ if (!target) {
18801881
}
18811882
}
18821883
var offsets = J2S.$offset(who.id);
1884+
if (!offsets) {
1885+
// someone forgot to remove the event handlers for an object removed from the DOM
1886+
J2S.unsetMouse(who);
1887+
return;
1888+
}
18831889
var x, y;
18841890
var oe = ev.originalEvent;
18851891
// drag-drop jQuery event is missing pageX

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10665,8 +10665,9 @@ return jQuery;
1066510665
})(jQuery,document,"click mousemove mouseup touchmove touchend", "outjsmol");
1066610666
// j2sApplet.js BH = Bob Hanson hansonr@stolaf.edu
1066710667

10668-
// J2S._version set to "3.2.4.07" 1/4/2019
10668+
// J2S._version set to "3.2.4.07" 2019.01.04; 2019.02.06
1066910669

10670+
// BH 2/6/2019 adds check for non-DOM event handler in getXY
1067010671
// BH 1/4/2019 moves window.thisApplet to J2S.thisApplet;
1067110672

1067210673
// see devnotes.txt for previous changes.
@@ -12545,6 +12546,11 @@ if (!target) {
1254512546
}
1254612547
}
1254712548
var offsets = J2S.$offset(who.id);
12549+
if (!offsets) {
12550+
// someone forgot to remove the event handlers for an object removed from the DOM
12551+
J2S.unsetMouse(who);
12552+
return;
12553+
}
1254812554
var x, y;
1254912555
var oe = ev.originalEvent;
1255012556
// drag-drop jQuery event is missing pageX

0 commit comments

Comments
 (0)