summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/index.js20
-rw-r--r--client/table/citations.table.js2
-rw-r--r--client/table/file.table.js2
3 files changed, 22 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js
index 5e36d341..c09aece7 100644
--- a/client/index.js
+++ b/client/index.js
@@ -2,6 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import { Provider } from 'react-redux'
+import 'waypoints/lib/noframework.waypoints.min.js';
import { toArray } from './util'
import Applet from './applet'
@@ -112,6 +113,24 @@ function runApplets() {
}
}
+function buildWaypoints() {
+ const element = document.querySelector('.content section:nth-child(2)')
+ if (element) {
+ var waypoint = new Waypoint({
+ element,
+ handler: function(direction) {
+ if (direction === 'down') {
+ document.body.classList.add('scrolled')
+ } else {
+ document.body.classList.remove('scrolled')
+ }
+ // console.log(direction)
+ // console.log('Scrolled to waypoint!')
+ }
+ })
+ }
+}
+
function main() {
const paras = document.querySelectorAll('section p')
// if (paras.length) {
@@ -123,6 +142,7 @@ function main() {
}
})
runApplets()
+ buildWaypoints()
}
main()
diff --git a/client/table/citations.table.js b/client/table/citations.table.js
index bbc55047..178cc65b 100644
--- a/client/table/citations.table.js
+++ b/client/table/citations.table.js
@@ -117,7 +117,7 @@ class CitationsTable extends Component {
columns={citationsColumns}
data={filteredCitations}
options={{
- height: 311,
+ height: Math.max(104, Math.min(37 * formattedCitations.length + 29, 311)),
layout: 'fitColumns',
placeholder: formattedCitations.length ? '' : 'Nothing matches your query',
}}
diff --git a/client/table/file.table.js b/client/table/file.table.js
index 82c01ac5..db53243a 100644
--- a/client/table/file.table.js
+++ b/client/table/file.table.js
@@ -71,7 +71,7 @@ class FileTable extends Component {
columns={this.state.columns}
data={this.state.data}
options={{
- height: 311,
+ height: Math.min(37 * this.state.data.length + 29, 311),
layout: 'fitColumns',
placeholder: 'No Data Set',
}}