Skip to content

Commit

Permalink
Merge pull request #60 from pifantastic/amd
Browse files Browse the repository at this point in the history
Fixes #38 and also fixes scoping of app shortcut
  • Loading branch information
tbranyen committed Feb 17, 2012
2 parents c702081 + 9b1bfb0 commit cda221c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ function(namespace, jQuery, Backbone, Example) {
}
});

// Shorthand the application namespace
var app = namespace.app;

// Treat the jQuery ready function as the entry point to the application.
// Inside this function, kick-off all initialization, everything up to this
// point should be definitions.
jQuery(function($) {
// Shorthand the application namespace
var app = namespace.app;

// Define your master router on the application namespace and trigger all
// navigation from this instance.
app.router = new Router();
Expand All @@ -65,7 +65,8 @@ function(namespace, jQuery, Backbone, Example) {
var protocol = this.protocol + "//";

// Ensure the protocol is not part of URL, meaning its relative.
if (href && href.slice(0, protocol.length) !== protocol) {
if (href && href.slice(0, protocol.length) !== protocol &&
href.indexOf("javascript:") !== 0) {
// Stop the default event to ensure the link will not cause a page
// refresh.
evt.preventDefault();
Expand Down
5 changes: 5 additions & 0 deletions build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ config.init({
"build/config.js", "app/**/*.js"
]
},
jshint: {
options: {
scripturl: true
}
},

// The jst task compiles all application templates into JavaScript functions
// with the underscore.js template function from 1.2.4. You can change the
Expand Down

0 comments on commit cda221c

Please sign in to comment.