workaround: always enable JS if webview has focus. fixes select box spinner close behavior on Android 4.4
This commit is contained in:
parent
4abe18d323
commit
adc5d16297
@ -144,9 +144,6 @@ window.runOnSmartphonesAfterBoot = function() {
|
|||||||
$("body").on("click", "select", function() {
|
$("body").on("click", "select", function() {
|
||||||
android.spinnerEnabled(true);
|
android.spinnerEnabled(true);
|
||||||
});
|
});
|
||||||
$("body").on("focus", "select", function() {
|
|
||||||
android.spinnerEnabled(false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add event to portals that allows long press to switch to sidebar
|
// add event to portals that allows long press to switch to sidebar
|
||||||
|
@ -46,7 +46,6 @@ public class IITC_JSInterface {
|
|||||||
// prevent the spinner from closing automatically
|
// prevent the spinner from closing automatically
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void spinnerEnabled(boolean en) {
|
public void spinnerEnabled(boolean en) {
|
||||||
Log.d("disableJS? " + en);
|
|
||||||
mIitc.getWebView().disableJS(en);
|
mIitc.getWebView().disableJS(en);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +171,8 @@ public class IITC_WebView extends WebView {
|
|||||||
public void onWindowFocusChanged(final boolean hasWindowFocus) {
|
public void onWindowFocusChanged(final boolean hasWindowFocus) {
|
||||||
if (hasWindowFocus) {
|
if (hasWindowFocus) {
|
||||||
getHandler().postDelayed(mNavHider, 3000);
|
getHandler().postDelayed(mNavHider, 3000);
|
||||||
|
// if the webView has focus, JS should always be enabled
|
||||||
|
mDisableJs = false;
|
||||||
} else {
|
} else {
|
||||||
getHandler().removeCallbacks(mNavHider);
|
getHandler().removeCallbacks(mNavHider);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user