Permalink
Browse files

no more history spamming! using replacestate

  • Loading branch information...
1 parent 944c633 commit 961746274dd897c673986101e68da19754f4d9ce @rgarcia committed Feb 18, 2012
Showing with 7 additions and 6 deletions.
  1. +2 −1 static/js/views/pagesearchheader.js
  2. +3 −3 static/js/views/pagetocbar.js
  3. +2 −2 static/js/views/searchheader.js
@@ -38,7 +38,8 @@ define([
var query = $.trim(this.$searchBox.val()).toLowerCase();
// TODO: replacestate...
- Backbone.history.navigate(this.languageName + '/' + query, false);
+ Backbone.history.navigate(this.languageName + '/' + query,
+ {trigger: false});
// Do this after we set url
var queryExists = (query !== '');
@@ -47,12 +47,12 @@ define([
// var topVal = $('#' + elementId).offset().top; // ID selection is the fastest
this.$searchResults.scrollTop(this.$searchResults.scrollTop() + topVal - 60);
- // Set url
- Backbone.history.navigate(this.lowercaseLanguageName + '/' + elementName, false);
+ // Set url
+ Backbone.history.navigate(this.lowercaseLanguageName + '/' + elementName,
+ {trigger: false});
}
});
return PageTOCBarView;
});
-
@@ -48,8 +48,8 @@ define([
searchFunc: function() {
var query = $.trim(this.$searchBox.val()).toLowerCase();
- // TODO: replacestate...
- Backbone.history.navigate(this.languageName + '/' + query, false);
+ Backbone.history.navigate(this.languageName + '/' + query,
+ {trigger: false, replace: true});
// Do this after we set url
var queryExists = (query !== '');

0 comments on commit 9617462

Please sign in to comment.