mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Add shiny:filedownload JS event
This commit is contained in:
@@ -8,3 +8,12 @@ $.extend(downloadLinkOutputBinding, {
|
||||
}
|
||||
});
|
||||
outputBindings.register(downloadLinkOutputBinding, 'shiny.downloadLink');
|
||||
|
||||
|
||||
// Trigger shiny:filedownload event whenever a downloadButton/Link is clicked
|
||||
$(document).on('click.shinyDownloadLink', 'a.shiny-download-link', function(e) {
|
||||
var evt = jQuery.Event('shiny:filedownload');
|
||||
evt.name = this.id;
|
||||
evt.href = this.href;
|
||||
$(document).trigger(evt);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user