Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/149798
Change subject: Hide the dictionary card till result recieved
......................................................................
Hide the dictionary card till result recieved
Avoids the flash of the card in the tools column
Bug: 68159
Change-Id: Ic5bd0aa5499899f50960c99f69290d4a3983b21a
---
M modules/tools/ext.cx.tools.dictionary.js
1 file changed, 17 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/98/149798/1
diff --git a/modules/tools/ext.cx.tools.dictionary.js
b/modules/tools/ext.cx.tools.dictionary.js
index 171a968..ca012fb 100644
--- a/modules/tools/ext.cx.tools.dictionary.js
+++ b/modules/tools/ext.cx.tools.dictionary.js
@@ -60,13 +60,15 @@
$expand = $( '<div>' )
.addClass( 'card__expand' );
- return this.$card.append(
+ this.$card.append(
$titleRow,
$headword,
this.$definition,
this.$translationsBlock,
$expand
);
+ this.hide();
+ return this.$card;
};
/**
@@ -90,6 +92,7 @@
DictionaryCard.prototype.showResult = function ( response ) {
var i, $translation;
+ this.show();
if ( response.translations && response.translations.length ) {
for ( i = 0; i < response.translations.length; i++ ) {
$translation = $( '<div>' )
@@ -104,7 +107,20 @@
this.stop();
}
}
+ };
+ /**
+ * Hide the card.
+ */
+ DictionaryCard.prototype.hide = function () {
+ this.$card.hide();
+ };
+
+ /**
+ * Show the card.
+ */
+ DictionaryCard.prototype.show = function () {
+ this.$card.show();
this.onShow();
};
--
To view, visit https://gerrit.wikimedia.org/r/149798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5bd0aa5499899f50960c99f69290d4a3983b21a
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