Your IP : 216.73.216.95


Current Path : /var/www/ljmtc/cbt/admin/tool/xmldb/amd/build/
Upload File :
Current File : /var/www/ljmtc/cbt/admin/tool/xmldb/amd/build/move.min.js.map

{"version":3,"sources":["../src/move.js"],"names":["define","$","SortableList","Ajax","Notification","init","tableid","moveaction","sort","getElementName","element","Deferred","resolve","attr","origIndex","on","EVENTS","DRAGSTART","_","info","sourceList","children","index","setTimeout","width","DROP","newIndex","targetList","t","find","positionChanged","length","request","methodname","args","action","dir","table","field","key","position","call","fail","exception"],"mappings":"AAeAA,OAAM,mBAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,WAAjC,CAA8C,mBAA9C,CAAD,CAAqE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA8C,CACrH,MAAO,CACHC,IAAI,CAAE,cAASC,CAAT,CAAkBC,CAAlB,CAA8B,CAEhC,GAAIC,CAAAA,CAAI,CAAG,GAAIN,CAAAA,CAAJ,CAAiB,IAAMI,CAAN,CAAgB,QAAjC,CAAX,CACAE,CAAI,CAACC,cAAL,CAAsB,SAASC,CAAT,CAAkB,CACpC,MAAOT,CAAAA,CAAC,CAACU,QAAF,GAAaC,OAAb,CAAqBF,CAAO,CAACG,IAAR,CAAa,WAAb,CAArB,CACV,CAFD,CAGA,GAAIC,CAAAA,CAAJ,CACAb,CAAC,CAAC,IAAMK,CAAN,CAAgB,WAAjB,CAAD,CAA+BS,EAA/B,CAAkCb,CAAY,CAACc,MAAb,CAAoBC,SAAtD,CAAiE,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE/EL,CAAS,CAAGK,CAAI,CAACC,UAAL,CAAgBC,QAAhB,GAA2BC,KAA3B,CAAiCH,CAAI,CAACT,OAAtC,CAAZ,CAEAa,UAAU,CAAC,UAAW,CAClBtB,CAAC,CAAC,2BAAD,CAAD,CAA+BuB,KAA/B,CAAqCL,CAAI,CAACT,OAAL,CAAac,KAAb,EAArC,CACH,CAFS,CAEP,GAFO,CAGb,CAPD,EAOGT,EAPH,CAOMb,CAAY,CAACc,MAAb,CAAoBS,IAP1B,CAOgC,SAASP,CAAT,CAAYC,CAAZ,CAAkB,IAE1CO,CAAAA,CAAQ,CAAGP,CAAI,CAACQ,UAAL,CAAgBN,QAAhB,GAA2BC,KAA3B,CAAiCH,CAAI,CAACT,OAAtC,CAF+B,CAG1CkB,CAAC,CAAGT,CAAI,CAACT,OAAL,CAAamB,IAAb,CAAkB,gBAAkBtB,CAAlB,CAA+B,GAAjD,CAHsC,CAI9C,GAAIY,CAAI,CAACW,eAAL,EAAwBF,CAAC,CAACG,MAA9B,CAAsC,CAClC,GAAIC,CAAAA,CAAO,CAAG,CACVC,UAAU,CAAE,+BADF,CAEVC,IAAI,CAAE,CACFC,MAAM,CAAE5B,CADN,CAEF6B,GAAG,CAAER,CAAC,CAACf,IAAF,CAAO,UAAP,CAFH,CAGFwB,KAAK,CAAET,CAAC,CAACf,IAAF,CAAO,YAAP,CAHL,CAIFyB,KAAK,CAAEV,CAAC,CAACf,IAAF,CAAO,YAAP,CAJL,CAKF0B,GAAG,CAAEX,CAAC,CAACf,IAAF,CAAO,UAAP,CALH,CAMFS,KAAK,CAAEM,CAAC,CAACf,IAAF,CAAO,YAAP,CANL,CAOF2B,QAAQ,CAAEd,CAAQ,CAAGZ,CAPnB,CAFI,CAAd,CAYAX,CAAI,CAACsC,IAAL,CAAU,CAACT,CAAD,CAAV,EAAqB,CAArB,EAAwBU,IAAxB,CAA6BtC,CAAY,CAACuC,SAA1C,CACH,CACJ,CA1BD,CA2BH,CAnCE,CAqCV,CAtCK,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\ndefine(['jquery', 'core/sortable_list', 'core/ajax', 'core/notification'], function($, SortableList, Ajax, Notification) {\n    return {\n        init: function(tableid, moveaction) {\n            // Initialise sortable for the given list.\n            var sort = new SortableList('#' + tableid + ' tbody');\n            sort.getElementName = function(element) {\n                return $.Deferred().resolve(element.attr('data-name'));\n            };\n            var origIndex;\n            $('#' + tableid + ' tbody tr').on(SortableList.EVENTS.DRAGSTART, function(_, info) {\n                // Remember position of the element in the beginning of dragging.\n                origIndex = info.sourceList.children().index(info.element);\n                // Resize the \"proxy\" element to be the same width as the main element.\n                setTimeout(function() {\n                    $('.sortable-list-is-dragged').width(info.element.width());\n                }, 501);\n            }).on(SortableList.EVENTS.DROP, function(_, info) {\n                // When a list element was moved send AJAX request to the server.\n                var newIndex = info.targetList.children().index(info.element);\n                var t = info.element.find('[data-action=' + moveaction + ']');\n                if (info.positionChanged && t.length) {\n                    var request = {\n                        methodname: 'tool_xmldb_invoke_move_action',\n                        args: {\n                            action: moveaction,\n                            dir: t.attr('data-dir'),\n                            table: t.attr('data-table'),\n                            field: t.attr('data-field'),\n                            key: t.attr('data-key'),\n                            index: t.attr('data-index'),\n                            position: newIndex - origIndex\n                        }\n                    };\n                    Ajax.call([request])[0].fail(Notification.exception);\n                }\n            });\n        }\n    };\n});\n"],"file":"move.min.js"}