Merge "mediawiki.notification: Use data-mw-foo instead of data-mw.foo"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 10 Sep 2018 18:38:04 +0000 (18:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 10 Sep 2018 18:38:04 +0000 (18:38 +0000)
resources/src/mediawiki.notification/notification.js

index d4bc7ad..cb3e4ae 100644 (file)
@@ -30,7 +30,7 @@
                var $notification, $notificationContent;
 
                $notification = $( '<div class="mw-notification"></div>' )
-                       .data( 'mw.notification', this )
+                       .data( 'mw-notification', this )
                        .addClass( options.autoHide ? 'mw-notification-autohide' : 'mw-notification-noautohide' );
 
                if ( options.tag ) {
                        // While there can be only one "open" notif with a given tag, there can be several
                        // matches here because they remain in the DOM until the animation is finished.
                        $tagMatches.each( function () {
-                               var notif = $( this ).data( 'mw.notification' );
+                               var notif = $( this ).data( 'mw-notification' );
                                if ( notif && notif.isOpen ) {
                                        // Detach from render flow with position absolute so that the new tag can
                                        // occupy its space instead.
         */
        function callEachNotification( $notifications, fn ) {
                $notifications.each( function () {
-                       var notif = $( this ).data( 'mw.notification' );
+                       var notif = $( this ).data( 'mw-notification' );
                        if ( notif ) {
                                notif[ fn ]();
                        }
                        } )
                        // When clicking on a notification close it.
                        .on( 'click', '.mw-notification', function () {
-                               var notif = $( this ).data( 'mw.notification' );
+                               var notif = $( this ).data( 'mw-notification' );
                                if ( notif ) {
                                        notif.close();
                                }