Jsahleen has uploaded a new change for review.

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

Change subject: Publishing: Fix publishing button disappearing on publish
......................................................................

Publishing: Fix publishing button disappearing on publish

* Removed old code that was hiding the publish button
* Code no longer needed now that we are autosaving
* After publishing, publishing button disabled until there is a new change.

Bug: T78004
Change-Id: Iaca2b008fae7505625435d2385f98eacd09c777f
---
M modules/header/ext.cx.header.js
M modules/publish/ext.cx.publish.js
2 files changed, 3 insertions(+), 8 deletions(-)


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

diff --git a/modules/header/ext.cx.header.js b/modules/header/ext.cx.header.js
index 7612b44..4d5bbad 100644
--- a/modules/header/ext.cx.header.js
+++ b/modules/header/ext.cx.header.js
@@ -203,8 +203,7 @@
                this.$publishButton = $( '<button>' )
                        .addClass( 'cx-header__publish-button mw-ui-button 
mw-ui-constructive' )
                        .prop( 'disabled', true )
-                       .text( mw.msg( 'cx-publish-button' ) )
-                       .hide();
+                       .text( mw.msg( 'cx-publish-button' ) );
 
                $publishArea = $( '<div>' )
                        .addClass( 'cx-header__publish' )
diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index ada7e17..00ca9c7 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -166,9 +166,8 @@
                        mw.log( '[CX] Error while publishing:', code, trace );
                } ).always( function () {
                        $publishButton
-                               .prop( 'disabled', false )
-                               .text( mw.msg( 'cx-publish-button' ) )
-                               .hide();
+                               .prop( 'disabled', true )
+                               .text( mw.msg( 'cx-publish-button' ) );
                } );
 
                initGuidedTour( translatedTitle );
@@ -225,8 +224,5 @@
 
        $( function () {
                mw.hook( 'mw.cx.publish' ).add( $.proxy( publish, this ) );
-               mw.hook( 'mw.cx.translation.saved' ).add( function () {
-                       $( '.cx-header__publish-button' ).show();
-               } );
        } );
 }( jQuery, mediaWiki ) );

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

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

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

Reply via email to