mediawiki.notification: Use data-mw-foo instead of data-mw.foo
authorFomafix <fomafix@googlemail.com>
Mon, 10 Sep 2018 13:53:31 +0000 (15:53 +0200)
committerFomafix <fomafix@googlemail.com>
Mon, 10 Sep 2018 13:58:04 +0000 (15:58 +0200)
All other data-mw attributes or .data() parameters use 'mw-foo' instead
of 'mw.foo'.

Change-Id: I2f7290c8a7ba1684c65b976c17912aa85846de02

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();
                                }