Skip to content

Commit

Permalink
fix bug: disable() didn't work on nested download buttons; fixes #223
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali committed Nov 18, 2020
1 parent d5f2fe2 commit 9920714
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyjs
Title: Easily Improve the User Experience of Your Shiny Apps in Seconds
Version: 2.0.0
Version: 2.0.0.9000
Authors@R: person("Dean", "Attali", email = "[email protected]",
role = c("aut", "cre"))
Description: Perform common useful JavaScript operations in Shiny apps that will
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased version

- Fix bug: `disable()` did not work on nested download buttons (#223)

# shinyjs 2.0.0 (2020-08-24)

- **IMPORTANT CHANGE** Remove commercial license (it only existed because some big companies asked for it, but it ended up being a bigger headache for 99% of the community)
Expand Down
6 changes: 3 additions & 3 deletions inst/srcjs/shinyjs-default-funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ shinyjs = function() {

// enable/disable the container as well as all individual inputs inside
// (this is needed for grouped inputs such as radio and checkbox groups)
var toadd = $el.find("input, button, textarea, select");
var toadd = $el.find("input, button, textarea, select, a[download]");
$el = $($el.toArray().concat(toadd.toArray()));
$el.attr('disabled', (method == "disable"));
$el.prop('disabled', (method == "disable"));
Expand Down Expand Up @@ -808,14 +808,14 @@ shinyjs = function() {
if ($el === null) return;
$el[0].click();
},

// refresh the page
refresh : function(params) {
var defaultParams = {
id : null
};
params = shinyjs.getParams(params, defaultParams);

window.location.reload(false);
}
};
Expand Down

0 comments on commit 9920714

Please sign in to comment.