Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313361

Change subject: Do not show the formater card if the section is not editable
......................................................................

Do not show the formater card if the section is not editable

Change-Id: Ic4a3720c383e6e76c4678897719e384570e6aace
---
M modules/tools/ext.cx.tools.formatter.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/61/313361/1

diff --git a/modules/tools/ext.cx.tools.formatter.js 
b/modules/tools/ext.cx.tools.formatter.js
index abdf87f..f43f4b6 100644
--- a/modules/tools/ext.cx.tools.formatter.js
+++ b/modules/tools/ext.cx.tools.formatter.js
@@ -193,8 +193,11 @@
        FormatTool.prototype.start = function ( section ) {
                this.$section = section.jquery ? section : getParentSection();
 
-               if ( this.$section.is( 'h1, h2, h3, h4, h5, h6, figure, table' 
) ) {
+               if ( this.$section.is( 'h1, h2, h3, h4, h5, h6, figure, table' 
) ||
+                       !this.$section.is( '[contenteditable="true"]' )
+               ) {
                        // Do not show formatting tool for headers, figures and 
tables.
+                       // Or if the field is not editable.
                        this.stop();
                        return;
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4a3720c383e6e76c4678897719e384570e6aace
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to