mirror of
https://github.com/moodle/moodle.git
synced 2025-02-21 09:52:54 +01:00
Unfortunately the babel minify-mangle plugin seems to be abandoned and in certain circumstances can be very buggy. The only safe options are to disable it, or to switch to a different minification library. Not minifying our javascript is not ideal, so this commit updates the javascript tasks to use a rollup, combined with babel, and terser. Babel still converts code from ES/UMD/AMD to AMD modules with the relevant browser support, whilst terser minifies the code. The rollup bundler handles tracking and creation of sourcemaps, and supports better parallelisation of the tasks. Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core and eslint, which change the built files anyway, this seems like the ideal time to make this change.
10 lines
1.5 KiB
JavaScript
10 lines
1.5 KiB
JavaScript
/**
|
|
* Controls the message popover in the nav bar.
|
|
*
|
|
* @module core_message/message_popover
|
|
* @copyright 2018 Ryan Wyllie <ryan@moodle.com>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
define("core_message/message_popover",["jquery","core/custom_interaction_events","core/pubsub","core_message/message_drawer_events"],(function($,CustomEvents,PubSub,MessageDrawerEvents){var SELECTORS_COUNT_CONTAINER='[data-region="count-container"]',handleDecrementConversationCount=function(button){return function(){var countContainer=button.find(SELECTORS_COUNT_CONTAINER),count=parseInt(countContainer.text(),10);isNaN(count)||!count||count<2?countContainer.addClass("hidden"):(count-=1,countContainer.text(count))}},registerEventListeners=function(button){CustomEvents.define(button,[CustomEvents.events.activate]),button.on(CustomEvents.events.activate,(function(e,data){var buttonid;buttonid=button.attr("id"),PubSub.publish(MessageDrawerEvents.TOGGLE_VISIBILITY,buttonid),button.focus(),data.originalEvent.preventDefault()})),PubSub.subscribe(MessageDrawerEvents.CONVERSATION_READ,handleDecrementConversationCount(button)),PubSub.subscribe(MessageDrawerEvents.CONTACT_REQUEST_ACCEPTED,handleDecrementConversationCount(button)),PubSub.subscribe(MessageDrawerEvents.CONTACT_REQUEST_DECLINED,handleDecrementConversationCount(button))};return{init:function(button){button=$(button),registerEventListeners(button)}}}));
|
|
|
|
//# sourceMappingURL=message_popover.min.js.map
|