ToddThomson/jQuery-Mobile-Subpage-Widget — pull request #17 by bdukes (2012-09-05 15:09:55+00:00)
Title: Don't create subpage if it already exists

I had some sub-page dialogs on my home page that needed to be accessible from child pages (called from a shared header). I added `data-prefetch` to the home link, which correctly loaded the dialogs, but ended up recreating the dialogs every time I went to any other page, creating many duplicates of the dialogs. Occasionally, I would see some ghosting when I tried to use the dialogs (I assume because there were multiples). This stops creating the sub-page if there's another element with the same ID (and detaches it from the DOM earlier, so it's out of the picture if this happens).