From 1d4822968e3aa5bbf3a8f6226b6d83c5d85989e6 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 9 Aug 2018 16:41:30 +0100 Subject: [PATCH] Toggle category sections --- frontend/building-edit.html | 28 +++++++++++++++++++-------- frontend/building-view.html | 24 +++++++++++++++-------- frontend/index.html | 20 +++++++++++++------ frontend/main.css | 12 +++++++++--- frontend/main.js | 38 ++++++++++++++++++++++++++++++++++++- frontend/maps.html | 20 +++++++++++++------ 6 files changed, 110 insertions(+), 32 deletions(-) diff --git a/frontend/building-edit.html b/frontend/building-edit.html index b4f50a44..bb0b8db1 100755 --- a/frontend/building-edit.html +++ b/frontend/building-edit.html @@ -60,8 +60,11 @@

Edit building data

- Location -
+ Location +
@@ -77,8 +80,11 @@
- Age -
+ Age +
@@ -92,8 +98,11 @@
- Size -
+ Size +
@@ -103,8 +112,11 @@
- -
+ +
diff --git a/frontend/building-view.html b/frontend/building-view.html index 8ee5b8c4..eb527caf 100755 --- a/frontend/building-view.html +++ b/frontend/building-view.html @@ -59,8 +59,10 @@

Building data

-

Location

-
+

Location

+
Building Name
no data
Building Number
@@ -76,8 +78,10 @@
-

Age

-
+

Age

+
Year built (best estimate)
2018
Year built (lower estimate)
@@ -91,8 +95,10 @@
-

Size

-
+

Size

+
Attic storeys
0
Core storeys
@@ -102,8 +108,10 @@
- -
+ +
Likes
25
diff --git a/frontend/index.html b/frontend/index.html index 916ff873..bdfa809d 100755 --- a/frontend/index.html +++ b/frontend/index.html @@ -65,9 +65,13 @@

Maps

-

Age

-
-
Year Built
+

Age

+
+
+ Year Built
  • @@ -151,9 +155,13 @@
-

Size

-
-
Number of storeys
+

Size

+
+
+ Number of storeys
  • diff --git a/frontend/main.css b/frontend/main.css index e49a392b..0ff7e538 100755 --- a/frontend/main.css +++ b/frontend/main.css @@ -442,9 +442,10 @@ small { } .bullet-prefix { position: relative; - padding-left: 1.5rem; + padding: 0rem 0.5rem 0.5rem 1.5rem; + cursor: pointer; } -.bullet-prefix:before { +.bullet-prefix::before { display: block; position: absolute; left: 0px; @@ -453,12 +454,17 @@ small { height: 10px; background-color: #7d7d7d; content: ' '; + transition: background-color 0.2s; +} +.bullet-prefix:hover::before, +.bullet-prefix.toggled-on::before { + background-color: #222; } .data-section .h3 { margin: 0; } .data-list { - margin: 0.5rem 0 1rem; + margin: 0rem 0 1rem; padding-left: 1.5rem; } .data-list a { diff --git a/frontend/main.js b/frontend/main.js index ab9d8a47..007712f0 100755 --- a/frontend/main.js +++ b/frontend/main.js @@ -152,6 +152,41 @@ function carousel(){ navigate(0); } +/** + * Expand/collapse + * + * Create a toggle with: + * - data-toggle="collapse" + * - data-target="" + * E.g. + *