MDL-68169 user: Limit the number of filter conditions
[moodle.git] / user / amd / build / unified_filter.min.js
CommitLineData
195ea448
RW
1define ("core_user/unified_filter",["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={UNIFIED_FILTERS:"#unified-filters"},f=function init(){M.util.js_pending("unified_filter_datasource");c.get_strings([{key:"userfilterplaceholder",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).done(function(a){var c=a[0],f=a[1];b.enhance(e.UNIFIED_FILTERS,!0,"core_user/unified_filter_datasource",c,!1,!0,f,!0).then(function(){M.util.js_complete("unified_filter_datasource")}).fail(d.exception)}).fail(d.exception);var f=a(e.UNIFIED_FILTERS).val();a(e.UNIFIED_FILTERS).on("change",function(){var b=a(this).val(),c=[],d=[],e=!1;a.each(b,function(a,b){var f=b.split(":",2);if(2!==f.length){d.push(b);return!0}var g=f[0],h=f[1];if("undefined"!=typeof c[g]){e=!0}c[g]=h;return!0});if(e){var g=[];for(var h in c){g.push(h+":"+c[h])}g=g.concat(d);a(this).val(g)}if(f.join(",")!=b.join(",")){this.form.submit()}})},g=function getForm(){return a(e.UNIFIED_FILTERS).closest("form")};return{init:function init(){f()},getForm:function getForm(){return g()}}});
2//# sourceMappingURL=unified_filter.min.js.map