Skip to content

Commit aa7b5b7

Browse files
committed
Use modals instead of javascript alerts
1 parent e91cce1 commit aa7b5b7

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

app/server.R

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ server <- function(input, output, session) {
151151
hinfo <- bull$x3p[[1]]$header.info
152152
if (hinfo$sizeX < hinfo$sizeY) {
153153
if (values$show_alert) {
154-
alert("Detected rotated bullet, rotating 90 degrees...")
154+
showModal(modalDialog(
155+
title = "Rotated Bullet",
156+
"Detected rotated bullet, rotating 90 degrees...",
157+
easyClose = TRUE,
158+
footer = modalButton("OK")
159+
))
155160
}
156161
values$show_alert <- FALSE
157162
bull$x3p <- lapply(bull$x3p, x3p_rotate, angle = 90)
@@ -166,15 +171,25 @@ server <- function(input, output, session) {
166171
# Down-sample if necessary
167172
if (reference_resolution > current_resolution) {
168173
if (values$show_alert) {
169-
alert("Detected higher resolution bullet, down-sampling...")
174+
showModal(modalDialog(
175+
title = "Higher Resolution Bullet",
176+
"Detected higher resolution bullet, down-sampling...",
177+
easyClose = TRUE,
178+
footer = modalButton("OK")
179+
))
170180
}
171181
values$show_alert <- FALSE
172182
m <- round(reference_resolution / current_resolution)
173183

174184
bull$x3p <- lapply(bull$x3p, x3p_sample, m = m)
175185
} else if (reference_resolution < current_resolution) {
176186
if (values$show_alert) {
177-
alert("Detected lower resolution bullet, down-sampling previous bullets...")
187+
showModal(modalDialog(
188+
title = "Lower Resolution Bullet",
189+
"Detected lower resolution bullet, down-sampling previous bullets...",
190+
easyClose = TRUE,
191+
footer = modalButton("OK")
192+
))
178193
}
179194
values$show_alert <- FALSE
180195

0 commit comments

Comments
 (0)