--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/ContentTranslation/modules/translation/ext.cx.translation.js 2016-08-30 11:19:02.910974283 +0000 +++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/ContentTranslation/modules/translation/ext.cx.translation.js 2016-09-06 16:27:32.944677947 +0000 @@ -369,6 +369,8 @@ // If source section has zero height, do not add a placeholder // Zero height means either the section is empty or invisible. if ( $sourceSection.height() === 0 ) { + // Hide the section to avoid the margin, if any, take up space. + $sourceSection.hide(); continue; } sourceSectionId = $sourceSection.attr( 'id' ); --- /srv/mediawiki/php-1.28.0-wmf.17/extensions/ContentTranslation/modules/tools/ext.cx.tools.mt.js 2016-08-30 11:19:02.906974252 +0000 +++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/ContentTranslation/modules/tools/ext.cx.tools.mt.js 2016-09-06 16:27:32.936677884 +0000 @@ -439,246 +439,6 @@ targetLanguage: mw.cx.targetLanguage }; - /** - * MT Control card - */ - function MTControlCard() { - this.mt = null; - this.$targetSection = null; - this.$sourceSection = null; - this.$card = null; - this.$translations = null; - this.$providersMenu = null; - } - - /** - * Prepare and return the card template. - * - * @return {jQuery} - */ - MTControlCard.prototype.getCard = function () { - var $titleRow, $title, $controlButtonsBlock; - - this.$card = $( '
' ) - .addClass( 'card mt' ); - - $title = $( '
' ) - .addClass( 'card__title' ) - .text( mw.msg( 'cx-tools-mt-title' ) ); - - $titleRow = $( '
' ) - .addClass( 'card__title-row' ) - .append( $title ); - - this.$providerSelectorTrigger = $( '
' ) - .addClass( 'card__trigger' ); - - this.$keepDefault = $( '
' ) - .addClass( 'card__control-button cx-mt-set-default' ) - .text( mw.msg( 'cx-tools-mt-set-default' ) ) - .hide(); - - $controlButtonsBlock = $( '
' ) - .addClass( 'card__button-block' ) - .append( this.$keepDefault ); - - this.$card.append( - $titleRow, - this.$providerSelectorTrigger, - $controlButtonsBlock - ); - this.$providersMenu = $( [] ); - - this.listen(); - - return this.$card; - }; - - /** - * Select a given provider id for the current section. - * - * @param {string} providerId Provider id - */ - MTControlCard.prototype.onProviderSelect = function ( providerId ) { - // Hide the menu - this.$providersMenu.hide(); - - // Set the main label - this.$providerSelectorTrigger.text( this.getProviderLabel( providerId ) ); - - // Apply the selected provider to the current section. - this.mt.changeProvider( providerId ); - this.mt.translate(); - }; - - MTControlCard.prototype.listen = function () { - var self = this; - - this.$providerSelectorTrigger - .on( 'click', function ( e ) { - self.$providersMenu.toggle(); - e.stopPropagation(); - } ); - - // Hide the dropdown on clicking outside of it - $( 'html' ).on( 'click', function ( e ) { - if ( !e.isDefaultPrevented() ) { - self.$providersMenu.hide(); - } - } ); - - this.$keepDefault.on( 'click', function () { - self.mt.setDefaultProvider( self.mt.provider ); - self.$keepDefault.hide(); - } ); - }; - - MTControlCard.prototype.buildProvidersMenu = function ( providers ) { - var i, self = this, - nonDefaultMT = false, - newProvider = false; - - this.$providersMenu = $( '