dobesv commented on a change in pull request #1995: DRILL-7605: Preserve query 
form field values between reloads / navigation
URL: https://github.com/apache/drill/pull/1995#discussion_r384766698
 
 

 ##########
 File path: exec/java-exec/src/main/resources/rest/query/query.ftl
 ##########
 @@ -87,13 +87,30 @@
   </form>
 
   <script>
+    // Remember form field values over page reloads
+    
$('input[type=text],input[type=checkbox],input[type=radio],select').each(function()
 {
+       var $input = $(this);
+       var key = 'saved_query_' + $input.attr('name');
+       var savedValue = sessionStorage.getItem(key);
+       if($input.attr("type") === 'checkbox') {
+         if(savedValue === 'true') $input.prop('checked', true);
 
 Review comment:
   I don't want to check the prop unless there is actually a valid value set in 
the session storage.  If the value is `null` and there's some other process 
that sets a default, we should keep that default (e.g. not uncheck a checkbox 
that would be checked by default).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to