Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 15th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. window.App = {
  2.   Models: {},
  3.   Collections: {},
  4.   Views: {},
  5.   Routers: {},
  6.   init: function(options) {
  7.     if (!options) {
  8.       options = {};
  9.     }
  10.     options.pushState = true;
  11.     options.hashChange = false;
  12.     Backbone.history.getHash = function() {
  13.       var search;
  14.       if (window.location.search) {
  15.         search = window.location.search;
  16.       } else {
  17.         search = '';
  18.       }
  19.       return window.location.pathname;
  20.     };
  21.     if (Backbone.history && !Backbone.History.started) {
  22.       return Backbone.history.start(options);
  23.     }
  24.   }
  25. };