-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7 previewer@main #33
7 previewer@main #33
Conversation
R/Previewer.R
Outdated
sprintf(' | ||
$(document).ready(function(event) { | ||
$("body").on("click", "span.card_remove_id", function() { | ||
var val = $(this).data("cardid"); | ||
let msg_confirm = "Do you really want to remove the card " + val + " from the Report?"; | ||
var answer = confirm(msg_confirm); | ||
if (answer) { | ||
Shiny.setInputValue("%s", val, {priority: "event"}); | ||
$("#panel_card_" + val).remove(); | ||
} | ||
}); | ||
|
||
$("body").on("click", "span.card_up_id", function() { | ||
var val = $(this).data("cardid"); | ||
Shiny.setInputValue("%s", val, {priority: "event"}); | ||
}); | ||
|
||
$("body").on("click", "span.card_down_id", function() { | ||
var val = $(this).data("cardid"); | ||
Shiny.setInputValue("%s", val, {priority: "event"}); | ||
}); | ||
}) | ||
', ns("card_remove_id"), ns("card_up_id"), ns("card_down_id")) | ||
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like idea of not creating observe for each remove/swap button!
THis card preview title is not a part of the report document, I do not think user want to customize it. This should be a proper name specified by the developer of the app who knows what It presents. More precisely a card preview title element is not a part of any end product here. Btw the card view is built by the developer too. |
We shall see :) |
Sorry, we think of the TextInput for all TextBlock in the future. I think this will make the app much more complex, code lines and reactivity. |
If we want to have disable option (when there are no cards) for download button in the previewer we have to apply:
I do not like any of the options so I leave it as it is. If you really want to have it I will go with the shinyjs solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will not be compatible with the simple previewer. |
fair enough, i will spin an issue for this task: #42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no more comments from my side and from @kpagacz .
Well done.
closes #7
closes #9
closes #19
I added a few new methods to ReportCard and Reporter.
jQuery + Shiny.setInputValue -> up/down/remove the previewer card
Accordion -> only one collapsible opened at the same time
The Tables are only printed to get the same output as Renderer, the formatting is persisted because of the pre html tag.
I have to add more tests and improve vignettes
Strange error to investigate (new issue) data.frame is not printed to the shiny output when run with green play button from them Rmd.
teal_reporter_previewer is a template for a function which have to be added later.