twbs / ratchet

Build mobile apps with simple HTML, CSS, and JavaScript components.
http://goratchet.com
MIT License
14.61k stars 1.45k forks source link

Using a custom router but keeping push js animations #697

Open Tarang opened 9 years ago

Tarang commented 9 years ago

We're using Meteor's DOM manipulation library, Blaze. The same thing could be said for reactJs.

Is it possible to use the animations in push.js but use the routing from these DOM libraries?

This is what a page looks like:

<template name="home">
    <div id="ios7-statusbar-fix"></div>
    <!-- Make sure all your bars are the first things in your <body> -->
    <header class="bar bar-nav">
        <h1 class="title">Title</h1>
    </header>

    <!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) -->
    <div class="content" style="padding-bottom: 50px;">
        <h6 style="text-align: center;">Last updated 15 mins ago</h6>
        <div class="card">
            {{>yield}}
        </div>
    </div>
</template>

The {{>yield}} is automatically patched with the new content. It can be moved to anywhere.

Additionally it is possible to make the whole page the yield.

Templates are stored in JS objects so its not really possible to fetch them as URLs, is there a way to use PushJS and somehow inject these in as DOM elements instead of a url to a html link?

helloworlder commented 9 years ago

683