Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/169991

Change subject: Progressbar: Change the progress info to tooltip
......................................................................

Progressbar: Change the progress info to tooltip

Change-Id: I954fc8ff38ad29ac52b886d33f4a1af1bb383cce
---
M modules/tools/ext.cx.progressbar.js
1 file changed, 11 insertions(+), 26 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/91/169991/1

diff --git a/modules/tools/ext.cx.progressbar.js 
b/modules/tools/ext.cx.progressbar.js
index 9c74e14..bf94838 100644
--- a/modules/tools/ext.cx.progressbar.js
+++ b/modules/tools/ext.cx.progressbar.js
@@ -36,31 +36,18 @@
                        )
                );
 
-               this.$info = $( '<div>' )
-                       .addClass( 'cx-progressbar__info' )
-                       .append(
-                               $( '<div>' ).addClass( 
'cx-progressbar__info--total' ),
-                               $( '<div>' ).addClass( 
'cx-progressbar__info--mt' )
-                       );
-
-               this.$container.append( this.$info.hide() );
                this.$bar = this.$container.find( '.cx-progressbar__bar' );
                this.$mtbar = this.$container.find( '.cx-progressbar__bar--mt' 
);
-               this.update( { maximum: 0, any: 0, human: 0, mt: 0 } );
+               this.update( {
+                       maximum: 0,
+                       any: 0,
+                       human: 0,
+                       mt: 0
+               } );
        };
 
        ProgressBar.prototype.listen = function () {
-               var progressBar = this;
-
                mw.hook( 'mw.cx.progress' ).add( $.proxy( this.update, this ) );
-
-               this.$container.on( 'mouseenter', '.cx-progressbar', function 
() {
-                       progressBar.$info.show();
-               } );
-
-               this.$container.on( 'mouseleave', '.cx-progressbar', function 
() {
-                       progressBar.$info.hide();
-               } );
        };
 
        ProgressBar.prototype.update = function ( weights ) {
@@ -71,14 +58,12 @@
                this.$bar.css( 'width', progress + '%' );
                this.$mtbar.css( 'width', mtProgress + '%' );
 
-               this.$info.find( '.cx-progressbar__info--total' )
-                       .text( mw.msg(
+               this.$container.attr( 'title',
+                       mw.msg(
                                'cx-header-progressbar-text',
-                               mw.language.convertNumber( parseInt( progress, 
10 ) )
-                       ) );
-
-               this.$info.find( '.cx-progressbar__info--mt' )
-                       .text( mw.msg(
+                               mw.language.convertNumber( parseInt( progress, 
10 ) ) ) +
+                       '\n' +
+                       mw.msg(
                                'cx-header-progressbar-text-mt',
                                mw.language.convertNumber( parseInt( 
mtPercentage, 10 ) )
                        ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/169991
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I954fc8ff38ad29ac52b886d33f4a1af1bb383cce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to