remove dialog from dialogStack if it is closed with 'ok' or 'close'
button
This commit is contained in:
parent
f6714a73c8
commit
48e60f809a
@ -62,7 +62,7 @@ window.dialog = function(options) {
|
|||||||
|
|
||||||
// hint for iitc mobile that a dialog was opened
|
// hint for iitc mobile that a dialog was opened
|
||||||
if (typeof android !== 'undefined' && android && android.dialogOpened) {
|
if (typeof android !== 'undefined' && android && android.dialogOpened) {
|
||||||
android.dialogOpened(id);
|
android.dialogOpened(id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert text to HTML if necessary
|
// Convert text to HTML if necessary
|
||||||
@ -179,6 +179,10 @@ window.dialog = function(options) {
|
|||||||
|
|
||||||
window.DIALOG_COUNT--;
|
window.DIALOG_COUNT--;
|
||||||
console.log('window.dialog: ' + $(this).data('id') + ' (' + $(this).dialog('option', 'title') + ') closed. ' + window.DIALOG_COUNT + ' remain.');
|
console.log('window.dialog: ' + $(this).data('id') + ' (' + $(this).dialog('option', 'title') + ') closed. ' + window.DIALOG_COUNT + ' remain.');
|
||||||
|
// hint for iitc mobile that a dialog was closed
|
||||||
|
if (typeof android !== 'undefined' && android && android.dialogOpened) {
|
||||||
|
android.dialogOpened(id, false);
|
||||||
|
}
|
||||||
|
|
||||||
// remove from DOM and destroy
|
// remove from DOM and destroy
|
||||||
$(this).dialog('destroy').remove();
|
$(this).dialog('destroy').remove();
|
||||||
|
@ -36,7 +36,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
|
|
||||||
private IITC_WebView iitc_view;
|
private IITC_WebView iitc_view;
|
||||||
private OnSharedPreferenceChangeListener listener;
|
private OnSharedPreferenceChangeListener listener;
|
||||||
private String intel_url = "https://www.ingress.com/intel";
|
String intel_url = "https://www.ingress.com/intel";
|
||||||
private boolean is_loc_enabled = false;
|
private boolean is_loc_enabled = false;
|
||||||
private Location last_location = null;
|
private Location last_location = null;
|
||||||
private LocationManager loc_mngr = null;
|
private LocationManager loc_mngr = null;
|
||||||
@ -547,8 +547,14 @@ public class IITC_Mobile extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// called by the javascript interface
|
// called by the javascript interface
|
||||||
public void dialogOpened(String id) {
|
public void dialogOpened(String id, boolean open) {
|
||||||
|
if (open) {
|
||||||
Log.d("iitcm", "Dialog " + id + " added");
|
Log.d("iitcm", "Dialog " + id + " added");
|
||||||
dialogStack.add(id);
|
dialogStack.add(id);
|
||||||
|
} else {
|
||||||
|
Log.d("iitcm", "Dialog " + id + " closed");
|
||||||
|
int index = dialogStack.indexOf(id);
|
||||||
|
dialogStack.remove(index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user