File tree Expand file tree Collapse file tree
src/e3sm_quickview/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def __init__(self, file_browser):
1212 with v3 .VDialog (
1313 model_value = (js .is_active ("load-data" ),),
1414 ** css .DIALOG_STYLES ,
15+ v_on_keyup_enter = file_browser .on_enter ,
1516 ):
1617 file_browser .ui ()
1718
@@ -23,6 +24,7 @@ def __init__(self):
2324 with v3 .VDialog (
2425 model_value = ("show_export_dialog" , False ),
2526 ** css .DIALOG_STYLES ,
27+ v_on_keyup_enter = "utils.quickview.saveState(download_name)" ,
2628 ):
2729 with v3 .VCard (title = "Save QuickView State file" , rounded = "lg" ):
2830 v3 .VDivider ()
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ def __init__(self, load_variables=None):
7878 style = (f"{ js .is_active ('select-fields' )} ? 'transform: none;' : ''" ,),
7979 )
8080
81+ self ._load_variables = load_variables
8182 self .state .setdefault ("loading_time" , 0 )
8283 self .state .setdefault (
8384 "visible_selection_icons" ,
@@ -93,6 +94,7 @@ def __init__(self, load_variables=None):
9394 with html .Div (
9495 style = "position:fixed;top:0;width: 500px;height:100vh;" ,
9596 classes = "d-flex flex-column" ,
97+ v_on_keyup_enter = self .on_enter ,
9698 ):
9799 with v3 .VCardActions (classes = "pb-0" , style = "min-height: 0;" ):
98100 v3 .VBtn (
@@ -271,3 +273,13 @@ def toggle_visible_selection(self):
271273 self .state .visible_selection_icon_idx += 1
272274 if self .state .visible_selection_icon_idx >= 3 :
273275 self .state .visible_selection_icon_idx = 0
276+
277+ def on_enter (self ):
278+ if (
279+ len (self .state .variables_selected ) == 0
280+ or self .state .variables_loaded
281+ or self .state .loading
282+ ):
283+ return
284+
285+ self ._load_variables ()
Original file line number Diff line number Diff line change @@ -470,3 +470,12 @@ def ui(self):
470470 loading = (self .name ("loading" ), False ),
471471 click = self .load_data_files ,
472472 )
473+
474+ def on_enter (self ):
475+ if self .get ("error" ):
476+ return
477+
478+ if self .get ("is_state_file" ):
479+ self .import_state_file ()
480+ elif self .get ("data_simulation" ) and self .get ("data_connectivity" ):
481+ self .load_data_files ()
You can’t perform that action at this time.
0 commit comments