Esanders has uploaded a new change for review.

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

Change subject: Don't allow extensions to have no content by default
......................................................................

Don't allow extensions to have no content by default

Change-Id: I5788de6d39aedb1f40842fa1e218374e330c9f6c
---
M modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/78/111178/1

diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js 
b/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
index b014e23..4380a8a 100644
--- a/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
+++ b/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
@@ -35,6 +35,8 @@
 
 ve.ui.MWExtensionInspector.static.removable = false;
 
+ve.ui.MWExtensionInspector.static.allowedEmpty = false;
+
 /* Methods */
 
 /**
@@ -109,6 +111,10 @@
        var mwData,
                surfaceModel = this.surface.getModel();
 
+       if ( !this.constructor.static.allowedEmpty && this.input.getValue() === 
'' ) {
+               return;
+       }
+
        if ( this.node instanceof this.constructor.static.nodeView ) {
                mwData = ve.copy( this.node.getModel().getAttribute( 'mw' ) );
                mwData.body.extsrc = this.input.getValue();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5788de6d39aedb1f40842fa1e218374e330c9f6c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

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

Reply via email to