diff --git a/davis.js b/davis.js index d199840..9b53288 100644 --- a/davis.js +++ b/davis.js @@ -350,8 +350,9 @@ Davis.listener = function () { * @memberOf listener */ this.listen = function () { - Davis.$(document).delegate(this.settings.formSelector, 'submit', submitHandler) - Davis.$(document).delegate(this.settings.linkSelector, 'click', clickHandler) + // Commenting these out because they are causing issues when we use 'forceHashRouting=true' + //Davis.$(document).delegate(this.settings.formSelector, 'submit', submitHandler) + //Davis.$(document).delegate(this.settings.linkSelector, 'click', clickHandler) } /** @@ -364,8 +365,9 @@ Davis.listener = function () { * @memberOf listener */ this.unlisten = function () { - Davis.$(document).undelegate(this.settings.linkSelector, 'click', clickHandler) - Davis.$(document).undelegate(this.settings.formSelector, 'submit', submitHandler) + // Commenting these out because they are causing issues when we use 'forceHashRouting=true' + //Davis.$(document).undelegate(this.settings.linkSelector, 'click', clickHandler) + //Davis.$(document).undelegate(this.settings.formSelector, 'submit', submitHandler) } } /*! @@ -1783,7 +1785,7 @@ Davis.App = (function () { var bindToInternalEvents = function () { self .bind('runRoute', function (request) { - self.logger.info("runRoute: " + request.toString()); + //self.logger.info("runRoute: " + request.toString()); }) .bind('routeNotFound', function (request) { if (!self.settings.handleRouteNotFound && !request.isForPageLoad) { @@ -1793,10 +1795,10 @@ Davis.App = (function () { self.logger.warn("routeNotFound: " + request.toString()); }) .bind('start', function () { - self.logger.info("application started") + //self.logger.debug("application started") }) .bind('stop', function () { - self.logger.info("application stopped") + //self.logger.debug("application stopped") }) .bind('routeError', function (request, route, error) { if (self.settings.throwErrors) throw(error) diff --git a/lib/extensions/davis.hashRouting.js b/lib/extensions/davis.hashRouting.js index cdecd6c..393b94e 100644 --- a/lib/extensions/davis.hashRouting.js +++ b/lib/extensions/davis.hashRouting.js @@ -206,7 +206,8 @@ Davis.hashRouting = function(options) { * @params {Request} the request to set the current location to. */ var wrapper = function(request, opts, setter) { - setter("#" + options.prefix + request.location()); + var location = request.location(); + setter( (location.match(/^\/?#/) ? '': '#') + options.prefix + location); lastPolledLocation = getLocation(); if (opts && opts.silent) return invokeCallbacks(request); diff --git a/tests/src b/tests/src deleted file mode 120000 index e831038..0000000 --- a/tests/src +++ /dev/null @@ -1 +0,0 @@ -src \ No newline at end of file