tweak pagination stuff

This commit is contained in:
Kevin Ngo
2018-07-22 11:54:26 +02:00
parent a8ed0dbf03
commit 2dd70589b6
2 changed files with 5 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ var algoliasearch = require('algoliasearch/lite');
var bindEvent = require('aframe-event-decorators').bindEvent;
var client = algoliasearch('QULTOY3ZWU', 'be07164192471df7e97e6fa70c1d041d');
var index = client.initIndex('supersaber');
var algolia = client.initIndex('supersaber');
/**
* Search (including the initial list of popular searches).
@@ -11,7 +11,7 @@ var index = client.initIndex('supersaber');
AFRAME.registerComponent('search', {
init: function() {
this.eventDetail = {results: []};
this.queryObject = {query: ''};
this.queryObject = {hitsPerPage: 30, query: ''};
// Populate popular.
this.search('');
@@ -23,7 +23,7 @@ AFRAME.registerComponent('search', {
search: function (query) {
this.queryObject.query = query;
index.search(this.queryObject, (err, content) => {
algolia.search(this.queryObject, (err, content) => {
this.eventDetail.results = content.hits;
this.el.sceneEl.emit('searchresults', this.eventDetail);
});

View File

@@ -13,8 +13,8 @@
geometry="primitive: plane; width: 0.9; height: 0.045"
material="color: #050505; shader: flat"
text="align: center; wrapCount: 40"></a-mixin>
<a-entity id="searchPrevPage" mixin="searchPageButton" bind-toggle__raycastable="search.hasPrev && menu.active" text="value: ^" position="-0.05 0.39 0" proxy-event="event: click; to: a-scene; as: searchprevpage"></a-entity>
<a-entity id="searchNextPage" mixin="searchPageButton" bind-toggle__raycastable="search.hasNext && menu.active" text="value: V" position="-0.05 -0.255 0" proxy-event="event: click; to: a-scene; as: searchnextpage"></a-entity>
<a-entity id="searchPrevPage" mixin="searchPageButton" bind-toggle__raycastable="search.hasPrev && menu.active" text="value: prev" position="-0.05 0.39 0" proxy-event="event: click; to: a-scene; as: searchprevpage" bind__visible="search.hasPrev"></a-entity>
<a-entity id="searchNextPage" mixin="searchPageButton" bind-toggle__raycastable="search.hasNext && menu.active" text="value: next" position="-0.05 -0.255 0" proxy-event="event: click; to: a-scene; as: searchnextpage" bind__visible="search.hasNext"></a-entity>
{% raw %}
<template id="searchResultTemplate">