You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2020/02/26 13:47:59 UTC

[GitHub] [drill] agozhiy commented on a change in pull request #1995: DRILL-7605: Preserve query form field values between reloads / navigation

agozhiy 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_r384487560
 
 

 ##########
 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:
   ```suggestion
            $input.prop('checked', savedValue === 'true');
   ```
   This should work.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services