C. Scott Ananian has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/378044 )
Change subject: Prevent language converter markup from spontaneously
disappearing
......................................................................
Prevent language converter markup from spontaneously disappearing
The first time the ve.ce.FocusableNode is initialized, it can correctly
determine that a ve.ce.MWLanguageVariantNode corresponding to a hidden
rule is "invisible". However, our invisible icon has a label, so the
second time ve.ce.FocusableNode looks at the hidden rule, it sees the
label and thinks the node isn't invisible any more. So it removes the
invisible icon... and then the node really *is* invisible.
Override ve.ce.FocusableNode#hasRendering with a model-based test to
bypass this confusion.
Change-Id: Ice7aebcc2f30dc73ef049a6ed0d4a0cffe86d8e2
---
M modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantNode.js
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/44/378044/1
diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantNode.js
b/modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantNode.js
index 1298647..31d4256 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantNode.js
@@ -163,6 +163,16 @@
};
/**
+ * @inheritdoc
+ */
+ve.ce.MWLanguageVariantNode.prototype.hasRendering = function() {
+ // Our "invisible icon" has a label, which confuses
+ // ve.ce.FocusableNode#hasRendering after the invisible icon is
+ // first created. Instead consult the model for a definitive answer.
+ return !this.model.isHidden();
+};
+
+/**
* ContentEditable MediaWiki language variant block node.
*
* @class
--
To view, visit https://gerrit.wikimedia.org/r/378044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice7aebcc2f30dc73ef049a6ed0d4a0cffe86d8e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits