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ACb,C","sources":["webpack:///indico/modules/events/tracks/client/js/index.js"],"sourcesContent":["// This file is part of Indico.\n// Copyright (C) 2002 - 2024 CERN\n//\n// Indico is free software; you can redistribute it and/or\n// modify it under the terms of the MIT License; see the\n// LICENSE file for more details.\n\n/* eslint-disable import/unambiguous */\n/* global handleAjaxError:false */\n(function(global) {\n function updateSorting() {\n const container = $('#track-list-container');\n const sortedList = container\n .find('li.track-row')\n .map(function() {\n const $this = $(this);\n if ($this.hasClass('track-group-box')) {\n return {id: $this.data('id'), type: 'group'};\n } else {\n let parent = null;\n const parentDiv = $this.closest('.track-group-box');\n if (parentDiv.length) {\n parent = parentDiv.data('id');\n }\n return {id: $this.data('id'), type: 'track', parent};\n }\n })\n .get();\n $.ajax({\n url: container.data('url'),\n method: 'POST',\n contentType: 'application/json',\n data: JSON.stringify({sort_order: sortedList}),\n complete: IndicoUI.Dialogs.Util.progress(),\n error: handleAjaxError,\n });\n }\n\n global.setupTrackManagement = function setupTrackManagement() {\n const heightLimit = 50;\n $('#track-list-container')\n .on('indico:htmlUpdated', function() {\n const $container = $(this);\n $container.find('.track-list .track-content').each(function() {\n const $this = $(this);\n if ($this.height() > heightLimit) {\n $this.addClass('track-content-collapsed track-content-collapsible');\n $this.on('click', function() {\n $this.toggleClass('track-content-collapsed');\n });\n }\n });\n\n $container.find('.track-list').sortable({\n items: '.track-row',\n handle: '.ui-i-box-sortable-handle',\n axis: 'y',\n cursor: 'move',\n distance: 2,\n forcePlaceholderSize: true,\n placeholder: 'track-placeholder',\n connectWith: '.track-list',\n update(_, ui) {\n // call update only once and only for the receiver\n if (this === ui.item.parent()[0]) {\n updateSorting();\n }\n },\n receive(_, ui) {\n const parentDiv = $(this).closest('.track-group-box');\n if (parentDiv.length && ui.item.hasClass('track-group-box')) {\n $(ui.sender).sortable('cancel');\n }\n },\n });\n })\n .trigger('indico:htmlUpdated');\n };\n})(window);\n"],"names":["window","setupTrackManagement","$","on","$container","this","find","each","$this","height","addClass","toggleClass","sortable","items","handle","axis","cursor","distance","forcePlaceholderSize","placeholder","connectWith","update","_","ui","item","parent","container","sortedList","map","hasClass","id","data","type","parentDiv","closest","length","get","ajax","url","method","contentType","JSON","stringify","sort_order","complete","IndicoUI","Dialogs","Util","progress","error","handleAjaxError","updateSorting","receive","sender","trigger"],"sourceRoot":""}