kkhatua commented on a change in pull request #1588: DRILL-6921: Add Clear 
button for /options filter
URL: https://github.com/apache/drill/pull/1588#discussion_r244368664
 
 

 ##########
 File path: exec/java-exec/src/main/resources/rest/options.ftl
 ##########
 @@ -24,8 +24,24 @@
     <script>
     //Alter System Values
     function alterSysOption(optionName, optionValue, optionKind) {
+        var currHref = location.href;
+        var redirectHref = currHref.replace(/(.?filter=).*/,"");
+        //Read filter value and apply to reload with new filter
+        var reApplyFilter = $("#searchBox").val();
+        if (reApplyFilter != null && reApplyFilter.trim().length > 0)  {
+            redirectHref = redirectHref + "?filter=" + reApplyFilter.trim();
+        } else { //Apply filter for updated field
+            redirectHref = redirectHref + "?filter=" + optionName;
+        }
+        //Debug
+        console.log("Current: "+currHref);
 
 Review comment:
   Will remove it. I had left it for logging purposes. It clears when the new 
page (with filter) loads. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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