Skip to content

Commit

Permalink
change click event to change event
Browse files Browse the repository at this point in the history
  • Loading branch information
hypebright committed Mar 17, 2024
1 parent 02739b3 commit 3bb1f41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion inst/shinyMobile-1.0.1/dist/shinyMobile.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/shinyMobile-1.0.1/dist/shinyMobile.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inst/shinyMobile-1.0.1/dist/shinyMobile.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions srcjs/bindings/treeviewInputBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ $.extend(f7TreeviewBinding, {
$targetEl
.closest(".treeview-item-selectable")
.addClass("treeview-item-selected");
// trigger change so value gets updated
$(el).trigger("change");
});
}

Expand Down Expand Up @@ -73,7 +75,8 @@ $.extend(f7TreeviewBinding, {
}

if (this.config[id].withCheckbox) {
var checked = $(el).find("input[type='checkbox']:checked");
// only return values of checked (under treeview-item-childern class)
var checked = $(el).find(".treeview-item-children input[type='checkbox']:checked");
var values = [];
checked.each(function() {
values.push($(this).closest(".treeview-item-content").find(".treeview-item-label").text());
Expand All @@ -91,7 +94,7 @@ $.extend(f7TreeviewBinding, {
},

subscribe: function(el, callback) {
$(el).on("click.treeview", function(e) {
$(el).on("change.treeview", function(e) {
callback();
});
},
Expand Down

0 comments on commit 3bb1f41

Please sign in to comment.