Kaldari has uploaded a new change for review.

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

Change subject: Allow null edits on mobile (same as desktop)
......................................................................

Allow null edits on mobile (same as desktop)

Previously, if someone tried to perform a null edit on mobile, it
would throw a JS Error: "No changes to save". The browser would
then become hung at the save screen.

Bug: T93029
Change-Id: Ib006985a8ebe57233e2ea1e8f393b1708aa49167
---
M javascripts/modules/editor/EditorApi.js
M tests/qunit/modules/editor/test_EditorApi.js
2 files changed, 0 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/46/197446/1

diff --git a/javascripts/modules/editor/EditorApi.js 
b/javascripts/modules/editor/EditorApi.js
index 6ddde71..3022c3c 100644
--- a/javascripts/modules/editor/EditorApi.js
+++ b/javascripts/modules/editor/EditorApi.js
@@ -130,10 +130,6 @@
 
                        options = options || {};
 
-                       if ( !this.hasChanged ) {
-                               throw new Error( 'No changes to save' );
-                       }
-
                        /**
                         * Save content. Make an API request.
                         * @ignore
diff --git a/tests/qunit/modules/editor/test_EditorApi.js 
b/tests/qunit/modules/editor/test_EditorApi.js
index adea339..0e90537 100644
--- a/tests/qunit/modules/editor/test_EditorApi.js
+++ b/tests/qunit/modules/editor/test_EditorApi.js
@@ -446,22 +446,6 @@
                assert.ok( !doneSpy.called, 'don\'t call done' );
        } );
 
-       QUnit.test( '#save, without changes', 2, function ( assert ) {
-               var editorApi = new EditorApi( {
-                       title: 'test',
-                       sectionId: 1
-               } );
-
-               assert.throws(
-                       function () {
-                               editorApi.save();
-                       },
-                       /no changes/i,
-                       'throw an error'
-               );
-               assert.ok( !editorApi.getToken.called, 'don\'t get the token' );
-       } );
-
        QUnit.test( '#getPreview', 2, function ( assert ) {
                var editorApi = new EditorApi( {
                        title: 'Test',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib006985a8ebe57233e2ea1e8f393b1708aa49167
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>

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

Reply via email to