Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/paged_content_paging_dropdown.min.js |
define ("core/paged_content_paging_dropdown",["jquery","core/custom_interaction_events","core/paged_content_events","core/pubsub"],function(a,b,c,d){var f={ROOT:"[data-region=\"paging-dropdown-container\"]",DROPDOWN_ITEM:"[data-region=\"dropdown-item\"]",DROPDOWN_TOGGLE:"[data-region=\"dropdown-toggle\"]",ACTIVE_DROPDOWN_ITEM:"[data-region=\"dropdown-item\"].active",CARET:"[data-region=\"caret\"]"},g=function(a){return parseInt(a.attr("data-page-number"),10)},h=function(a){return a.find(f.DROPDOWN_ITEM)},i=function(b,c){var d=g(c);return h(b).filter(function(b,c){return g(a(c))<d})},j=function(a){return parseInt(a.attr("data-item-count"),10)},k=function(b,c){if(c.attr("data-offset")!=void 0){return parseInt(c.attr("data-offset"),10)}var d=0;i(b,c).each(function(b,c){c=a(c);d+=j(c)});c.attr("data-offset",d);return d},l=function(a){return a.find(f.ACTIVE_DROPDOWN_ITEM)},m=function(b,c){return c.map(function(c,d){d=a(d);return{pageNumber:g(d),limit:j(d),offset:k(b,d)}}).get()},n=function(b){b.each(function(b,c){c=a(c);c.attr("data-page-number",b+1)})},o=function(a,b,e){var g=i(a,b),h=g.add(b),j=m(a,h),k=a.find(f.DROPDOWN_TOGGLE),n=k.find(f.CARET);l(a).removeClass("active");b.addClass("active");k.html(b.text());k.append(n);d.publish(e+c.SHOW_PAGES,j)};return{init:function init(c,d){c=a(c);var e=h(c);n(e);var g=l(c);if(g.length){o(c,g,d)}b.define(c,[b.events.activate]);c.on(b.events.activate,f.DROPDOWN_ITEM,function(b,e){var g=a(b.target).closest(f.DROPDOWN_ITEM);o(c,g,d);e.originalEvent.preventDefault()})},rootSelector:f.ROOT}}); //# sourceMappingURL=paged_content_paging_dropdown.min.js.map