let iitcm react on the dialog focused callback
This commit is contained in:
		@@ -205,6 +205,10 @@ window.dialog = function(options) {
 | 
			
		||||
 | 
			
		||||
      // This dialog is now in focus
 | 
			
		||||
      window.DIALOG_FOCUS = this;
 | 
			
		||||
      // hint for iitc mobile that a dialog was focused
 | 
			
		||||
      if (typeof android !== 'undefined' && android && android.dialogFocused) {
 | 
			
		||||
        android.dialogFocused($(window.DIALOG_FOCUS).data('id'));
 | 
			
		||||
      }
 | 
			
		||||
      $(this).closest('.ui-dialog').find('.ui-dialog-title').removeClass('ui-dialog-title-inactive').addClass('ui-dialog-title-active');
 | 
			
		||||
    }
 | 
			
		||||
  }, options));
 | 
			
		||||
 
 | 
			
		||||
@@ -114,6 +114,11 @@ public class IITC_JSInterface {
 | 
			
		||||
        ((IITC_Mobile) context).dialogOpened(id, open);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @JavascriptInterface
 | 
			
		||||
    public void dialogFocused(String id) {
 | 
			
		||||
        ((IITC_Mobile) context).setFocusedDialog(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // get layers and list them in a dialog
 | 
			
		||||
    @JavascriptInterface
 | 
			
		||||
    public void setLayers(String base_layer, String overlay_layer) {
 | 
			
		||||
 
 | 
			
		||||
@@ -559,6 +559,15 @@ public class IITC_Mobile extends Activity {
 | 
			
		||||
        item.setVisible(!desktop);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // remove dialog and add it back again
 | 
			
		||||
    // to ensure it is the last element of the list
 | 
			
		||||
    // focused dialogs should be closed first
 | 
			
		||||
    public void setFocusedDialog(String id) {
 | 
			
		||||
        Log.d("iitcm", "Dialog " + id + " focused");
 | 
			
		||||
        dialogStack.remove(id);
 | 
			
		||||
        dialogStack.add(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // called by the javascript interface
 | 
			
		||||
    public void dialogOpened(String id, boolean open) {
 | 
			
		||||
        if (open) {
 | 
			
		||||
@@ -566,8 +575,7 @@ public class IITC_Mobile extends Activity {
 | 
			
		||||
            dialogStack.add(id);
 | 
			
		||||
        } else {
 | 
			
		||||
            Log.d("iitcm", "Dialog " + id + " closed");
 | 
			
		||||
            int index = dialogStack.indexOf(id);
 | 
			
		||||
            dialogStack.remove(index);
 | 
			
		||||
            dialogStack.remove(id);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user