1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-22 06:01:42 +00:00

Closes #305: exclude tags from search

This commit is contained in:
Benjamin Gamard
2019-05-03 15:35:47 +02:00
parent d654564f6b
commit 8b1c41ae1e
5 changed files with 41 additions and 3 deletions

View File

@@ -319,9 +319,9 @@ angular.module('docs').controller('Document', function ($scope, $rootScope, $tim
*/
$scope.extractNavigatedTag = function () {
// Find the current tag in the search query
var tagFound = /tag:([^ ]*)/.exec($scope.search);
var tagFound = /(^| )tag:([^ ]*)/.exec($scope.search);
if (tagFound) {
tagFound = tagFound[1];
tagFound = tagFound[2];
// We search only for exact match
$scope.navigatedTag = _.findWhere($scope.tags, { name: tagFound });
} else {