jenkins-bot has submitted this change and it was merged.

Change subject: Disable tools other than links and references on mobile
......................................................................


Disable tools other than links and references on mobile

Temporary measure so that we don't show mobile context when we
shouldn't.

Change-Id: I19c4ed2aa361bec385ae7888ee62fc2cc916b9b8
---
M modules/ve/ui/ve.ui.MobileContext.js
1 file changed, 21 insertions(+), 0 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/ve/ui/ve.ui.MobileContext.js 
b/modules/ve/ui/ve.ui.MobileContext.js
index 42c7160..51cf072 100644
--- a/modules/ve/ui/ve.ui.MobileContext.js
+++ b/modules/ve/ui/ve.ui.MobileContext.js
@@ -72,3 +72,24 @@
 
        return deferred.promise();
 };
+
+/**
+ * @inheritdoc
+ */
+ve.ui.MobileContext.prototype.getAvailableTools = function () {
+       var tools = ve.ui.MobileContext.super.prototype.getAvailableTools.call( 
this );
+
+       // Filter out tools not supported in mobile mode
+       // FIXME: This is a temporary hack. Ideally, we don't want to load any 
code
+       // that is not supported on a given platform. However, present 
implementation
+       // of citation dialog forces us to load tools that we don't want on 
mobile.
+       this.availableTools = tools.filter( function ( tool ) {
+               return (
+                       tool.model instanceof ve.dm.MWInternalLinkAnnotation ||
+                       tool.model instanceof ve.dm.MWExternalLinkAnnotation ||
+                       tool.model instanceof ve.dm.MWReferenceNode
+               );
+       } );
+
+       return this.availableTools;
+};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I19c4ed2aa361bec385ae7888ee62fc2cc916b9b8
Gerrit-PatchSet: 2
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: JGonera <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to