diff --git a/code/smartphone.js b/code/smartphone.js index d01d2545..c9133aab 100644 --- a/code/smartphone.js +++ b/code/smartphone.js @@ -144,9 +144,6 @@ window.runOnSmartphonesAfterBoot = function() { $("body").on("click", "select", function() { android.spinnerEnabled(true); }); - $("body").on("focus", "select", function() { - android.spinnerEnabled(false); - }); } // add event to portals that allows long press to switch to sidebar diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java index cd7aee85..78080700 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java @@ -46,7 +46,6 @@ public class IITC_JSInterface { // prevent the spinner from closing automatically @JavascriptInterface public void spinnerEnabled(boolean en) { - Log.d("disableJS? " + en); mIitc.getWebView().disableJS(en); } diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java index 19781705..9963e432 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java @@ -171,6 +171,8 @@ public class IITC_WebView extends WebView { public void onWindowFocusChanged(final boolean hasWindowFocus) { if (hasWindowFocus) { getHandler().postDelayed(mNavHider, 3000); + // if the webView has focus, JS should always be enabled + mDisableJs = false; } else { getHandler().removeCallbacks(mNavHider); }