Community
cancel
Showing results for 
Search instead for 
Did you mean: 
tetsuya
Beginner
53 Views

jqm_subpage trigger event pagechange on $(document) not $(sel)

Hi,

I've tried to create new mobile application with App Designer and I selected jQuery Mobile.

When I use subpage, xdk/ad/jqm_subpage.js is added to my project by XDK.
It seems to trigger event "pagechange" in subpage navigation, but it triggered on $(document) and no other arguments.
So, I can't use that event to handle subpage navigation.

I think it should be triggered on $(sel) instead.
How about that?

(edited after posted)
I'd like to propose following modification so that I can handle subpage navigations.

*** jqm_subpage.js_orig	Wed Feb 23 14:42:36 2016
--- jqm_subpage.js	Wed Feb 24 12:28:08 2016
***************
*** 11,17 ****
      var parent_vis = $(parent_sel).is(":visible");
      if(parent_vis)
      {
-         $(document).trigger("pagechange");
          if(!have_state){ window.history.pushState({usubpage:sel}, sel, document.location.origin + document.location.pathname + "#" +sel); }
      }
      else
--- 11,16 ----
***************
*** 20,25 ****
--- 19,25 ----
          $.mobile.changePage(parent_sel);
          window.history.replaceState({usubpage:sel}, sel, document.location.origin + document.location.pathname + "#" + sel);
      }
+     $dn.trigger("pagechange");
  }
  
  

 

Regards,
--
tetsuya

Tags (2)
0 Kudos
2 Replies
PaulF_IntelCorp
Employee
53 Views

I will forward your suggestion to the engineer in charge.

Markus_G_1
Beginner
53 Views

+1 for this as it makes things work as implicated by JQM.

Right now the 'pagechange' event for subpages work as a 'pageleave' event.

Reply