Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/e3sm_quickview/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,20 @@ def data_loading_hide(self):
tool for tool in self.state.active_tools if tool != "load-data"
]

@trigger("enter_load_files")
def _enter_load_files(self):
"""Route Enter key to load files or import state in the file dialog."""
s = self.state
if s[self.file_browser.name("is_state_file")]:
self.file_browser.import_state_file()
elif (
s[self.file_browser.name("data_simulation")]
and s[self.file_browser.name("data_connectivity")]
and not s[self.file_browser.name("error")]
):
self.file_browser.load_data_files()

@trigger("data_load_variables")
def data_load_variables(self):
self.state.loading = True
asynchronous.create_task(self._data_load_variables())
Expand Down
4 changes: 4 additions & 0 deletions src/e3sm_quickview/components/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def __init__(self, file_browser):
with v3.VDialog(
model_value=(js.is_active("load-data"),),
**css.DIALOG_STYLES,
raw_attrs=["@keyup.enter=\"trigger('enter_load_files')\""],
):
file_browser.ui()

Expand All @@ -22,6 +23,9 @@ def __init__(self):
with v3.VDialog(
model_value=("show_export_dialog", False),
**css.DIALOG_STYLES,
raw_attrs=[
"@keyup.enter=\"show_export_dialog=false;utils.download(download_name, trigger('download_state'), 'application/json')\""
],
):
with v3.VCard(title="Download QuickView State file", rounded="lg"):
v3.VDivider()
Expand Down
3 changes: 3 additions & 0 deletions src/e3sm_quickview/components/drawers.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def __init__(self, load_variables=None):
with html.Div(
style="position:fixed;top:0;width: 500px;height:100vh;",
classes="d-flex flex-column",
raw_attrs=[
"@keyup.enter=\"variables_selected.length > 0 && !variables_loaded && !loading ? trigger('data_load_variables') : null\""
],
):
with v3.VCardActions(classes="pb-0", style="min-height: 0;"):
v3.VBtn(
Expand Down
Loading