jenkins-bot has submitted this change and it was merged. Change subject: Remove usage of removed hooks ......................................................................
Remove usage of removed hooks Change-Id: I37d79b61578a273c4c798f5d3663acb6ecb42e31 --- M hooks.md M modules/tools/ext.cx.tools.mt.js M modules/translation/ext.cx.translation.js 3 files changed, 1 insertion(+), 21 deletions(-) Approvals: KartikMistry: Looks good to me, but someone else must approve Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/hooks.md b/hooks.md index ba53bde..1d7ac55 100644 --- a/hooks.md +++ b/hooks.md @@ -98,14 +98,6 @@ Fired when the translation section changed because of any reason. -## mw.cx.translation.clear - -Fired when the translation section is cleared. - -## mw.cx.translation.edit - -Fired when translator edits the translation section, for example by typing. - ## mw.cx.translation.focus Fired when translation section receives focus. diff --git a/modules/tools/ext.cx.tools.mt.js b/modules/tools/ext.cx.tools.mt.js index 299c26a..c29a25b 100644 --- a/modules/tools/ext.cx.tools.mt.js +++ b/modules/tools/ext.cx.tools.mt.js @@ -261,7 +261,7 @@ this.$restore .on( 'click', $.proxy( this.restoreTranslation, this ) ); - mw.hook( 'mw.cx.translation.edit' ).add( $.proxy( this.showRestore, this ) ); + mw.hook( 'mw.cx.translation.change' ).add( $.proxy( this.showRestore, this ) ); }; MTControlCard.prototype.buildProvidersMenu = function () { diff --git a/modules/translation/ext.cx.translation.js b/modules/translation/ext.cx.translation.js index f445e5e..3925663 100644 --- a/modules/translation/ext.cx.translation.js +++ b/modules/translation/ext.cx.translation.js @@ -106,18 +106,6 @@ }, 2000 ); } ); - // The translation for a section was cleared. - // The translator either deleted the content - // or used the clear translation tool. - // Present the placeholder for the section to user. - mw.hook( 'mw.cx.translation.clear' ).add( function ( sourceId ) { - var targetSectionId = '#cx' + sourceId, - $placeholder = getPlaceholder( sourceId ); - - mw.hook( 'mw.cx.translation.change' ).fire( $( targetSectionId ) ); - $( targetSectionId ).replaceWith( $placeholder ); - } ); - mw.hook( 'mw.cx.translation.change' ).add( function ( $section ) { if ( $section ) { $section.keepAlignment(); -- To view, visit https://gerrit.wikimedia.org/r/158350 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37d79b61578a273c4c798f5d3663acb6ecb42e31 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com> Gerrit-Reviewer: Santhosh <santhosh.thottin...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits