Skip to content

Commit 32116d2

Browse files
Merge pull request #11 from robotboy655/patch-1
Navigating back to main page works
2 parents ec101c3 + 804c228 commit 32116d2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

app/scripts/controllers.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,15 @@ angular.module('docsApp.controllers', [])
187187
window.onpopstate = function( e ) {
188188
resultsResetScroll();
189189
$scope.$apply(function() {
190-
var filter = $location.search().f;
191-
if ( filter ) {
192-
$scope.docFilter = filter; // Update content
193-
$scope.query = ''; // Update the sidebar
194-
$scope.queryModel = ''; // Update the search text
195-
}
196-
197190
var query = $location.search().q;
198191
if ( query ) {
199192
$scope.docFilter = query;
200193
$scope.query = query;
201194
$scope.queryModel = query;
195+
} else {
196+
$scope.docFilter = $location.search().f || ''; // Update content
197+
$scope.query = ''; // Update the sidebar
198+
$scope.queryModel = ''; // Update the search text
202199
}
203200
});
204201
}

0 commit comments

Comments
 (0)