1
0
mirror of https://github.com/danog/schema.tl.git synced 2024-12-02 09:18:02 +01:00

Heckin good changes

This commit is contained in:
TJ Horner 2017-08-21 18:54:14 -07:00
parent d5689ff2c7
commit a72f6f7dac
4 changed files with 8 additions and 3 deletions

View File

@ -115,6 +115,7 @@ header {
.hero-typeahead .typeahead-result { .hero-typeahead .typeahead-result {
padding: 15px; padding: 15px;
cursor: pointer;
} }
.hero-typeahead .typeahead-result.selected { .hero-typeahead .typeahead-result.selected {

View File

@ -1,13 +1,13 @@
<html ng-app="tlDocsApp"> <html ng-app="tlDocsApp">
<head> <head>
<title>TL-Schema Explorer</title> <title>TL-Schema Explorer</title>
<link rel="stylesheet" href="/css/styles.css"> <link rel="stylesheet" href="/css/styles.css?v2">
<link rel="stylesheet" href="/css/fonts.css"> <link rel="stylesheet" href="/css/fonts.css">
<link rel="stylesheet" href="/css/rgs.css"> <link rel="stylesheet" href="/css/rgs.css">
<script src="/js/schema.js"></script> <script src="/js/schema.js"></script>
<script src="/js/angular.min.js"></script> <script src="/js/angular.min.js"></script>
<script src="/js/ngroute.min.js"></script> <script src="/js/ngroute.min.js"></script>
<script src="/js/app.js"></script> <script src="/js/app.js?v2"></script>
<meta property="og:title" content="TL-Schema Explorer"> <meta property="og:title" content="TL-Schema Explorer">
<meta property="og:site_name" content="TL-Schema Explorer"> <meta property="og:site_name" content="TL-Schema Explorer">

View File

@ -185,6 +185,10 @@ tlDocsApp.controller("mainController", function($scope, $rootScope, $location, s
$location.path(`/${result.type}/${result.name}`) $location.path(`/${result.type}/${result.name}`)
} }
$scope.clickResult = function(result) {
$location.path(`/${result.type}/${result.name}`)
}
if($rootScope.globalSearch) { if($rootScope.globalSearch) {
$scope.search = $rootScope.globalSearch $scope.search = $rootScope.globalSearch
document.getElementById("heroSearchBar").focus() document.getElementById("heroSearchBar").focus()

View File

@ -6,7 +6,7 @@
<div class="hero-input"> <div class="hero-input">
<input type="text" id="heroSearchBar" class="hero-search" placeholder="{{ searchPlaceholder }}" ng-model="search" ng-focus="displayTypeahead = true" ng-blur="displayTypeahead = false" ng-change="updateSearchResults()" my-enter="goToResult()" my-arrow-down="selectedResult = (selectedResult === 100 ? selectedResult : selectedResult + 1)" my-arrow-up="selectedResult = (selectedResult === 0 ? selectedResult : selectedResult - 1)"> <input type="text" id="heroSearchBar" class="hero-search" placeholder="{{ searchPlaceholder }}" ng-model="search" ng-focus="displayTypeahead = true" ng-blur="displayTypeahead = false" ng-change="updateSearchResults()" my-enter="goToResult()" my-arrow-down="selectedResult = (selectedResult === 100 ? selectedResult : selectedResult + 1)" my-arrow-up="selectedResult = (selectedResult === 0 ? selectedResult : selectedResult - 1)">
<div class="hero-typeahead"> <div class="hero-typeahead">
<div class="typeahead-result {{ result.type }} {{ selectedResult === index ? 'selected' : '' }}" ng-repeat="(index, result) in typeaheadResults | limitTo:50 track by $index"> <div class="typeahead-result {{ result.type }} {{ selectedResult === index ? 'selected' : '' }}" ng-repeat="(index, result) in typeaheadResults | limitTo:50 track by $index" ng-click="clickResult(result)">
{{ result.name }} {{ result.name }}
</div> </div>
</div> </div>