Skip to content

Commit

Permalink
simplifying the no re-render bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Gamache committed Jun 25, 2012
1 parent f73f97d commit 91073e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc-assets/templates/in-the-works.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<section id="in-the-works" class="in-the-works">
<p class="section-header"><strong>In the works.</strong> These are a few things I am still working on pulling together for Glue:</p>
<p><strong>Callback after rendereding templates</strong> will allow for custom functions after a Glue template renders</p>
<p><s><strong>Fix multiple render calls</strong> because it's just using uneccessary computing power and is sloppy. Fix it.</s></p>
<p><strong>Exit class application</strong> primarily for "animating out" of Glue templates</p>
<p><strong>Making the index URL accessible from the back button.</strong> Since there is no fragment to indicate template, Glue won't allow you to click "back" to the index.html page.</p>
<p><strong>Add a data-paramater to Glue links to set the container.</strong> All Glue links right now assume to .glue-container as the wrapping element, but it would be nice to be able to set a different container.</p>
<p><strong>Use with JS template compilers</strong>. This means you will be able to use syntax of your choice - for example Mustache, Dust or Jade. This will also mean you can mash data into your templates.</p>
<p><s><strong>Fix multiple render calls</strong> because it's just using uneccessary computing power and is sloppy. Fix it.</s></p>
</section>
9 changes: 5 additions & 4 deletions source/glue.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ $(function() {
// Main vars----------------------------------------
var includes = $('[data-glue-src]');
var links = $('[data-glue-link]');
var fragment = getFragment();
var defaultYield = $('.glue-container');

// URL Routing -------------------------------------
if(getFragment()) {
routeToTemplate(getFragment());
if(fragment) {
routeToTemplate(fragment);
}

// Back button -------------------------------------
window.onpopstate = function(event) {
if(getFragment()) {
routeToTemplate(getFragment());
if(fragment) {
routeToTemplate(fragment);
}
};

Expand Down

0 comments on commit 91073e8

Please sign in to comment.