Skip to content

Commit

Permalink
feat: add selected app and table to shiny inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepanshKhurana committed May 3, 2024
1 parent f3bb202 commit 2c31ace
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/js/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
export function toggleIcon() {
$('.argus-icon').click((evt) => {
const target = evt.currentTarget;
const selectedApp = $('#app-selector-application').val();
const selectedTable = $('#app-selector-table').val();

// This condition is reversed becuase if the eye has a class, that means
// it will be toggled. In other words, hasClass tells wasClass

const mode = $(target).hasClass('fa-eye') ? 'add' : 'view';
$(target).toggleClass('fa-eye fa-eye-dropper');

Shiny.setInputValue(
'app-app_mode',
mode,
{ priority: 'event' },
);

Shiny.setInputValue(
'app-selected_app',
selectedApp,
{ priority: 'event' },
);

Shiny.setInputValue(
'app-selected_table',
selectedTable,
{ priority: 'event' },
);
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/static/js/app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c31ace

Please sign in to comment.