summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/common/index.js3
-rw-r--r--frontend/common/loader.component.js16
-rw-r--r--frontend/common/miscellaneous.component.js11
-rw-r--r--frontend/site/site/site.actions.js20
-rw-r--r--frontend/site/viewer/viewer.container.js2
-rw-r--r--frontend/views/page/components/tile.handle.js2
-rw-r--r--frontend/views/page/cursors.css15
-rw-r--r--frontend/views/page/page.container.js1
-rw-r--r--frontend/views/page/page.css15
9 files changed, 46 insertions, 39 deletions
diff --git a/frontend/common/index.js b/frontend/common/index.js
index 3647203..5c0dc50 100644
--- a/frontend/common/index.js
+++ b/frontend/common/index.js
@@ -8,9 +8,10 @@ export {
LabelDescription, ColorInput,
} from './form.component'
export {
- Loader, Swatch, Dot, Columns, Statistic, Detections, Progress
+ Swatch, Dot, Columns, Statistic, Detections, Progress
} from './miscellaneous.component'
export { default as TableIndex } from './tableIndex.component'
+export { Loader } from './loader.component'
export {
TableObject, TableArray, TableTuples,
TableRow, TableCell
diff --git a/frontend/common/loader.component.js b/frontend/common/loader.component.js
new file mode 100644
index 0000000..f0a0c69
--- /dev/null
+++ b/frontend/common/loader.component.js
@@ -0,0 +1,16 @@
+import React, { Component } from 'react';
+
+import './loader.css'
+
+const Loader = () => (
+ <div>
+ <div className='circular-loader color'>
+ <div className="stroke">
+ <div className="stroke-left"></div>
+ <div className="stroke-right"></div>
+ </div>
+ </div>
+ </div>
+)
+
+export { Loader }
diff --git a/frontend/common/miscellaneous.component.js b/frontend/common/miscellaneous.component.js
index 4eb23f1..cf12ef5 100644
--- a/frontend/common/miscellaneous.component.js
+++ b/frontend/common/miscellaneous.component.js
@@ -2,17 +2,6 @@ import React, { Component } from 'react';
import { Link } from 'react-router-dom'
import { clamp, percent } from '../util'
-export const Loader = () => (
- <div>
- <div className='circular-loader color'>
- <div className="stroke">
- <div className="stroke-left"></div>
- <div className="stroke-right"></div>
- </div>
- </div>
- </div>
-)
-
export const Swatch = ({ color }) => (
<div
className='swatch'
diff --git a/frontend/site/site/site.actions.js b/frontend/site/site/site.actions.js
index 2362e5f..5724df8 100644
--- a/frontend/site/site/site.actions.js
+++ b/frontend/site/site/site.actions.js
@@ -11,14 +11,14 @@ export const setSiteTitle = title => dispatch => {
export const loadSite = (graph_name, path_name) => dispatch => (
api(dispatch, types.site, 'site', '/' + graph_name + '/index.json')
- .then(res => {
- const { graph } = res.data
- // console.log(graph)
- // console.log(graph.home_page)
- const first_path = ["", graph_name, path_name].join("/")
- if (!path_name || !(first_path in graph.pages)) {
- // console.log(graph.home_page)
- window.location.href = graph.home_page
- }
- })
+ // .then(res => {
+ // const { graph } = res.data
+ // // console.log(graph)
+ // // console.log(graph.home_page)
+ // const first_path = ["", graph_name, path_name].join("/")
+ // if (!path_name || !(first_path in graph.pages)) {
+ // // console.log(graph.home_page)
+ // window.location.href = graph.home_page
+ // }
+ // })
)
diff --git a/frontend/site/viewer/viewer.container.js b/frontend/site/viewer/viewer.container.js
index 68088d2..da81551 100644
--- a/frontend/site/viewer/viewer.container.js
+++ b/frontend/site/viewer/viewer.container.js
@@ -4,7 +4,7 @@ import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import actions from '../actions'
-import { Loader } from '../../common'
+import { Loader } from '../../common/loader.component'
import TileHandle from '../../views/page/components/tile.handle'
import '../../views/page/page.css'
diff --git a/frontend/views/page/components/tile.handle.js b/frontend/views/page/components/tile.handle.js
index f3a700b..bd47ae9 100644
--- a/frontend/views/page/components/tile.handle.js
+++ b/frontend/views/page/components/tile.handle.js
@@ -11,7 +11,7 @@ const TileHandle = ({ tile, bounds, box, viewing, onMouseDown, onDoubleClick })
// console.log(generateTransform(tile))
let content;
let className = ['tile', tile.type].join(' ')
- if (tile.target_page_id) {
+ if (tile.target_page_id || (viewing && tile.href)) {
className += ' ' + (tile.settings.cursor || 'hand_up')
}
// console.log(tile.settings)
diff --git a/frontend/views/page/cursors.css b/frontend/views/page/cursors.css
new file mode 100644
index 0000000..5f90dd1
--- /dev/null
+++ b/frontend/views/page/cursors.css
@@ -0,0 +1,15 @@
+/* cursors */
+/* keep in separate file so they don't conflict. a copy of this lives in site.css */
+
+.tile.hand_up {
+ cursor: url(/static/img/hand_up.png) 40 10, pointer;
+}
+.tile.hand_right {
+ cursor: url(/static/img/hand_right.png) 90 40, pointer;
+}
+.tile.hand_down {
+ cursor: url(/static/img/hand_down.png) 60 90, pointer;
+}
+.tile.hand_left {
+ cursor: url(/static/img/hand_left.png) 10 60, pointer;
+}
diff --git a/frontend/views/page/page.container.js b/frontend/views/page/page.container.js
index 5da41d6..26bed30 100644
--- a/frontend/views/page/page.container.js
+++ b/frontend/views/page/page.container.js
@@ -4,6 +4,7 @@ import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import './page.css'
+import './cursors.css'
import actions from '../../actions'
import { Loader } from '../../common'
diff --git a/frontend/views/page/page.css b/frontend/views/page/page.css
index c29aff2..ec41241 100644
--- a/frontend/views/page/page.css
+++ b/frontend/views/page/page.css
@@ -168,18 +168,3 @@
width: 6rem;
max-width: 6rem;
}
-
-/* cursors */
-
-.tile.hand_up {
- cursor: url(/static/img/hand_up.png) 40 10, pointer;
-}
-.tile.hand_right {
- cursor: url(/static/img/hand_right.png) 90 40, pointer;
-}
-.tile.hand_down {
- cursor: url(/static/img/hand_down.png) 60 90, pointer;
-}
-.tile.hand_left {
- cursor: url(/static/img/hand_left.png) 10 60, pointer;
-}