Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/paged_content_paging_bar_limit_selector.min.js.map |
{"version":3,"sources":["../src/paged_content_paging_bar_limit_selector.js"],"names":["define","$","CustomEvents","PagedContentEvents","PubSub","SELECTORS","ROOT","LIMIT_OPTION","LIMIT_TOGGLE","init","root","id","events","activate","on","e","data","optionElement","target","closest","hasClass","limit","parseInt","attr","publish","SET_ITEMS_PER_PAGE_LIMIT","originalEvent","preventDefault","rootSelector"],"mappings":"AAsBAA,OAAM,gDACN,CACI,QADJ,CAEI,gCAFJ,CAGI,2BAHJ,CAII,aAJJ,CADM,CAON,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKE,IAEMC,CAAAA,CAAS,CAAG,CACZC,IAAI,CAAE,kDADM,CAEZC,YAAY,CAAE,cAFF,CAGZC,YAAY,CAAE,gCAHF,CAFlB,CAsCE,MAAO,CACHC,IAAI,CAxBG,QAAPA,CAAAA,IAAO,CAASC,CAAT,CAAeC,CAAf,CAAmB,CAC1BD,CAAI,CAAGT,CAAC,CAACS,CAAD,CAAR,CAEAR,CAAY,CAACF,MAAb,CAAoBU,CAApB,CAA0B,CACtBR,CAAY,CAACU,MAAb,CAAoBC,QADE,CAA1B,EAIAH,CAAI,CAACI,EAAL,CAAQZ,CAAY,CAACU,MAAb,CAAoBC,QAA5B,CAAsCR,CAAS,CAACE,YAAhD,CAA8D,SAASQ,CAAT,CAAYC,CAAZ,CAAkB,CAC5E,GAAIC,CAAAA,CAAa,CAAGhB,CAAC,CAACc,CAAC,CAACG,MAAH,CAAD,CAAYC,OAAZ,CAAoBd,CAAS,CAACE,YAA9B,CAApB,CAEA,GAAIU,CAAa,CAACG,QAAd,CAAuB,QAAvB,CAAJ,CAAsC,CAElC,MACH,CAED,GAAIC,CAAAA,CAAK,CAAGC,QAAQ,CAACL,CAAa,CAACM,IAAd,CAAmB,YAAnB,CAAD,CAAmC,EAAnC,CAApB,CAEAnB,CAAM,CAACoB,OAAP,CAAeb,CAAE,CAAGR,CAAkB,CAACsB,wBAAvC,CAAiEJ,CAAjE,EAEAL,CAAI,CAACU,aAAL,CAAmBC,cAAnB,EACH,CAbD,CAcH,CAEM,CAEHC,YAAY,CAAEvB,CAAS,CAACC,IAFrB,CAIV,CAtDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Javascript for dynamically changing the page limits.\n *\n * @module core/paged_content_paging_bar_limit_selector\n * @copyright 2018 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n 'jquery',\n 'core/custom_interaction_events',\n 'core/paged_content_events',\n 'core/pubsub'\n],\nfunction(\n $,\n CustomEvents,\n PagedContentEvents,\n PubSub\n) {\n\n var SELECTORS = {\n ROOT: '[data-region=\"paging-control-limit-container\"]',\n LIMIT_OPTION: '[data-limit]',\n LIMIT_TOGGLE: '[data-action=\"limit-toggle\"]',\n };\n\n /**\n * Trigger the SET_ITEMS_PER_PAGE_LIMIT event when the page limit option\n * is modified.\n *\n * @param {object} root The root element.\n * @param {string} id A unique id for this instance.\n */\n var init = function(root, id) {\n root = $(root);\n\n CustomEvents.define(root, [\n CustomEvents.events.activate\n ]);\n\n root.on(CustomEvents.events.activate, SELECTORS.LIMIT_OPTION, function(e, data) {\n var optionElement = $(e.target).closest(SELECTORS.LIMIT_OPTION);\n\n if (optionElement.hasClass('active')) {\n // Don't do anything if it was the active option selected.\n return;\n }\n\n var limit = parseInt(optionElement.attr('data-limit'), 10);\n // Tell the rest of the pagination components that the limit has changed.\n PubSub.publish(id + PagedContentEvents.SET_ITEMS_PER_PAGE_LIMIT, limit);\n\n data.originalEvent.preventDefault();\n });\n };\n\n return {\n init: init,\n rootSelector: SELECTORS.ROOT\n };\n});\n"],"file":"paged_content_paging_bar_limit_selector.min.js"}