Merge branch 'MDL-66372' of https://github.com/Chocolate-lightning/moodle_forum-project
authorJun Pataleta <jun@moodle.com>
Thu, 7 Nov 2019 05:22:32 +0000 (13:22 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 7 Nov 2019 05:22:32 +0000 (13:22 +0800)
1  2 
mod/forum/report/summary/amd/build/filters.min.js
mod/forum/report/summary/amd/build/filters.min.js.map
mod/forum/report/summary/amd/src/filters.js

@@@ -69,16 -102,19 +103,24 @@@ export const init = (root) => 
  
      // Override pagination page links so they generate with filters.
      $('.pagination').on("click", "a", function(event) {
-         generateWithFilters(event);
+         generateWithFilters(event, event.target.search.substr(1));
      });
  
+     // Override rows per page submission so it generates with filters.
+     if (document.forms.selectperpage) {
+         document.forms.selectperpage.onsubmit = (event) => {
+             let getparam = 'perpage=' + document.forms.selectperpage.elements.perpage.value;
+             generateWithFilters(event, getparam);
+         };
+     }
      // Submit report via filter
      const submitWithFilter = (containerelement) => {
 +        // Disable the dates filter mform checker to prevent any changes triggering a warning to the user.
 +        Y.use('moodle-core-formchangechecker', function() {
 +            M.core_formchangechecker.reset_form_dirty_state();
 +        });
 +
          // Close the container (eg popover).
          $(containerelement).addClass('hidden');