Skip to content

Commit 63e12ac

Browse files
committed
Merge branch 'master' of https://github.com/canjs/bit-docs-html-canjs into 277-close-menu-mobile
2 parents a791b9d + 84771cb commit 63e12ac

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

static/canjs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var $articleContainer,
4040
if (noModifierKeys && sameHostname && sameProtocol) {
4141
ev.preventDefault();
4242
var href = this.href;
43-
window.history.pushState(null, null, href);
4443
navigate(href);
4544
}
4645
});
@@ -92,7 +91,6 @@ function init() {
9291
if (!searchControl) {
9392
searchControl = new SearchControl(".search-bar", {
9493
navigate: function(href){
95-
window.history.pushState(null, null, href);
9694
navigate(href);
9795
},
9896
pathPrefix: window.pathPrefix,
@@ -249,8 +247,11 @@ function navigate(href) {
249247
if(searchControl.searchResultsCache){
250248
searchControl.renderSearchResults(searchControl.searchResultsCache);
251249
}
250+
251+
window.history.pushState(null, null, href);
252252
},
253253
error: function() {
254+
window.history.pushState(null, null, href);
254255
// just reload the page if this fails
255256
window.location.reload();
256257
},

static/search.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -463,21 +463,6 @@ var Search = Control.extend({
463463
self.clear();
464464
});
465465
}
466-
467-
// if we click the list item, navigate
468-
// if the target element is an anchor tag, simply clear
469-
if(this.$resultsContainer && this.$resultsContainer.length){
470-
this.$resultsContainer.on("click.search-component", ".search-results > ul > li", function(ev){
471-
var $target = $(ev.target),
472-
$a;
473-
474-
if(!$target.is("a")){
475-
$a = $target.closest("li").find("a");
476-
self.navigate($a.attr("href"));
477-
return;
478-
}
479-
});
480-
}
481466
},
482467
unbindResultsEvents: function(){
483468
//hide the search on cancel click

0 commit comments

Comments
 (0)