Browse Source

Put the button where people expect it

Petra Lamborn 3 years ago
parent
commit
90e67460f0
2 changed files with 18 additions and 12 deletions
  1. 12
    10
      viz/app.R
  2. 6
    2
      viz/extras.R

+ 12
- 10
viz/app.R View File

@@ -99,14 +99,7 @@ ui <- fluidPage(
99 99
                 div(id="loc2"),
100 100
                     htmlOutput("secondarylochtml"))
101 101
                 ),
102
-  absolutePanel(top = 25, right = 10, id="control2",
103
-                materialSwitch("controlswitch", value=TRUE, right=TRUE,
104
-                               inline=TRUE, status="info")),
105
-  absolutePanel(bottom = 26, right = 10, id="loading",
106
-                p("Loading...")),
107
-  absolutePanel(bottom=26, right=10, left=10, top=10, id="infopanel",
108
-                infotext),
109
-  absolutePanel(bottom=10, left=10, id="infobuttoncontainer",
102
+  absolutePanel(top=10, right=10, id="infobuttoncontainer",
110 103
     prettyToggle("mapinfobutton", 
111 104
                  label_on = HTML("<span class='shortcut'>I</span>nfo"),
112 105
                  label_off = HTML("<span class='shortcut'>I</span>nfo"),
@@ -115,9 +108,18 @@ ui <- fluidPage(
115 108
                  animation = "pulse",
116 109
                  inline = TRUE,
117 110
                  status_on = "danger",
118
-                 status_off = "info",
111
+                 status_off = "primary",
119 112
                  value = TRUE)
120
-  )
113
+  ),
114
+  absolutePanel(top = 40, right = 7.5, id="control2", title="Toggle panel",
115
+                prettySwitch("controlswitch", value=TRUE, label = NULL,
116
+                             slim = FALSE,
117
+                               inline=TRUE, status="info",
118
+                             fill=FALSE, bigger=FALSE)),
119
+  absolutePanel(bottom = 26, right = 10, id="loading",
120
+                p("Loading...")),
121
+  absolutePanel(bottom=26, right=10, left=10, top=10, id="infopanel",
122
+                infotext)
121 123
 )
122 124
 
123 125
 # Define server logic

+ 6
- 2
viz/extras.R View File

@@ -22,7 +22,7 @@ html, body {
22 22
   font-weight: bold;
23 23
   margin: 0;
24 24
 }
25
-#mapcontrol, #infobuttoncontainer, #infopanel {
25
+#mapcontrol, #infopanel {
26 26
   background-color: rgba(255, 255, 255, 0.8);
27 27
   border-radius: 5px;
28 28
   box-shadow: 0 0 15px rgba(0,0,0,0.2);
@@ -54,8 +54,9 @@ html, body {
54 54
   background-color: #84e1e1;
55 55
 }
56 56
 #infobuttoncontainer {
57
-  margin-bottom: 16px;
57
+  padding: 6px 8px;
58 58
   z-index: 1002;
59
+  font: 14px/16px Arial, Helvetica, sans-serif;
59 60
 }
60 61
 #infobuttoncontainer .shiny-input-container,
61 62
 #infobuttoncontainer div div {
@@ -144,6 +145,9 @@ kbd:hover {
144 145
 .btn.radiobtn {
145 146
     text-align: left;
146 147
 }
148
+#control2 .state label {
149
+    width: 0px;
150
+}
147 151
 "
148 152
 
149 153
 attribhtml <- '