Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PURE plugin fix & warn on load error #113

wants to merge 5 commits into
Commits on Oct 9, 2011
  1. Use PURE's render() instead of autoRender() if directives are given. …

    bard committed Oct 9, 2011
    …autoRender() with directives leads to unexpected results.
    Before the fix, this test case results in the error "The node
    .summary-text" was not found in the template" being printed to the
    console and the template not being processed as expected.
        <!DOCTYPE html>
            <script type="text/javascript" src="js/jquery.min.js"></script>
            <script type="text/javascript" src="js/pure.js"></script>
            <script type="text/javascript" src="js/sammy/sammy.js"></script>
            <script type="text/javascript" src="js/sammy/plugins/sammy.pure.js"></script>
            <script type="text/javascript">
                var app = $.sammy('#main', function() {
                    this.get('#/', function(context) {
                        var data = {
                            summary: 'buy bread',
                            state: 'done'
                        var directives = {
                            '.summary-text': 'summary',
                            '.state': 'state'
                        context.pure('#main', data, directives);
                $(document).ready(function() {
            <div id="main">
              <div class="summary">[<span class="state"></span>] <span class="summary-text"></span></div>
  2. Don't assume happy path, give some notice if load() errors out (e.g. …

    bard committed Oct 9, 2011
    …because of JSON parse error).
Commits on Feb 8, 2012
  1. Allow setting an 'exit' callback for when a route is left.

    bard committed Feb 8, 2012
    this.get('#/foo/bar', function(context) {
        // business as usual
    }, function() {
        // run when user navigates away from #/foo/bar
        // useful e.g. to undo anything specific to the #/foo/bar view
  2. Missing bit from fb40b1f.

    bard committed Feb 8, 2012