Skip to content

Commit

Permalink
fix for intermittent search filter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehollis committed Jun 27, 2015
1 parent 682a1a7 commit 25cad0f
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions coptic/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ angular.module('coptic')

// Persistent location Path
$scope.path = location.pathname.split("/");
console.log($scope.path);

// Filters for the search tools
$scope.filters = [];
Expand Down Expand Up @@ -193,6 +194,7 @@ angular.module('coptic')
*/
$scope.update = function() {
$scope.path = location.pathname.split("/");
console.log($scope.path);

// If the application location is index
if( $scope.path.length == 0 || ( $scope.path.length > 1 && $scope.path[1] === "" ) ){
Expand Down Expand Up @@ -236,15 +238,30 @@ angular.module('coptic')


// If the application location is at /filters/:filters
}else if ( $scope.path.length === 3 ) {
}else if ( $scope.path.length === 3 ) {

// load filters
$scope.load_filters();

// Ensure single is null
$scope.is_single = false;
$scope.selected_text = null;
$scope.selected_text_format = null;
if ( $scope.path[2].length !== 0 ){
// load filters
$scope.load_filters();

// Ensure single is null
$scope.is_single = false;
$scope.selected_text = null;
$scope.selected_text_format = null;
}else {
// Default to displaying no texts, only show the landing page description text
$scope.texts = [];

// Wipe Search Terms / Filters
$scope.filters = [];
$(".selected").removeClass("selected");
$("meta[name=corpus_urn]").attr("content", "" );
$("meta[name=document_urn]").attr("content", "" );
$("meta[name=mss_urn]").attr("content", "" );


}


// If the application location is at /text/:corpus_slug/:text_slug
Expand Down

0 comments on commit 25cad0f

Please sign in to comment.