Skip to content

Commit 0a68c7e

Browse files
hansonrhansonr
authored andcommitted
allows for null return from ajax
1 parent 7e3fa3d commit 0a68c7e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,8 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
797797
info.xhr = J2S.$ajax(info);
798798
if (!fSuccess) {
799799
data = J2S._xhrReturn(info.xhr);
800+
if (data == null)
801+
doProcess = null;
800802
}
801803
}
802804
if (!doProcess)
@@ -810,6 +812,8 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
810812
}
811813

812814
J2S._xhrReturn = function(xhr) {
815+
if (xhr.state() == "rejected")
816+
return null;
813817
if (!xhr.responseText && !xhr.responseJSON || self.Clazz
814818
&& Clazz.instanceOf(xhr.response, self.ArrayBuffer)) {
815819
// Safari or error
@@ -2922,11 +2926,15 @@ if (!target) {
29222926
return a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0
29232927
})
29242928
var z0 = zbase;
2929+
var z0 = zbase;
29252930
for (var i = 0; i < a.length; i++) {
2926-
a[i][1].style.zIndex = zbase;
2931+
if (!a[i][1].ui || !a[i][1].ui.embeddingNode)
2932+
a[i][1].style.zIndex = zbase;
29272933
zbase += 1000;
29282934
}
2929-
z = (node.style.zIndex = (z > 0 ? zbase : z0));
2935+
z = (z > 0 ? zbase : z0);
2936+
if (!node.ui || !node.ui.embeddingNode) // could be popupMenu, with no ui
2937+
node.style.zIndex = z;
29302938
node.style.position = "absolute";
29312939
if (J2S._checkLoading)
29322940
System.out.println("setting z-index to " + z + " for " + node.id);

0 commit comments

Comments
 (0)