Merge "Deprecate EditFilterMerged hook, final ContentHandler replaced hook"
[lhc/web/wiklou.git] / resources / src / mediawiki / page / gallery-slideshow.js
index 85ded44..cf448b0 100644 (file)
 
                toggle = new OO.ui.ButtonWidget( {
                        framed: false,
-                       icon: 'imageGallery'
+                       icon: 'imageGallery',
+                       title: mw.msg( 'gallery-slideshow-toggle' )
                } ).on( 'click', this.toggleThumbnails.bind( this ) );
 
                interfaceElements = new OO.ui.PanelLayout( {
                // Show thumbnail stretched to the right size while the image loads
                this.$thumbnail = imageLi.find( 'img' );
                this.$img.attr( 'src', this.$thumbnail.attr( 'src' ) );
+               this.$img.attr( 'alt', this.$thumbnail.attr( 'alt' ) );
                this.$imgLink.attr( 'href', imageLi.find( 'a' ).eq( 0 ).attr( 'href' ) );
                this.setImageSize();
 
                var api, title, params,
                        imageSrc = $img.attr( 'src' );
 
+               // Reject promise if there is no thumbnail image
+               if ( $img[ 0 ] === undefined ) {
+                       return $.Deferred().reject();
+               }
+
                if ( this.imageInfoCache[ imageSrc ] === undefined ) {
                        api = new mw.Api();
                        // TODO: This supports only gallery of images