From 58cc1251be33b43a5bb9163e1b042970b8e81b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 24 Apr 2017 22:18:52 +0200 Subject: [PATCH] Use "complete" callback in onPasswordEntered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- core/js/sharedialoglinkshareview.js | 3 +-- core/js/tests/specs/sharedialoglinkshareview.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index e7371d98f4..0e317d8c92 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -307,13 +307,12 @@ this.model.saveLinkShare({ password: password }, { - success: function(model) { + complete: function(model) { $loading.removeClass('inlineblock').addClass('hidden'); }, error: function(model, msg) { // destroy old tooltips $input.tooltip('destroy'); - $loading.removeClass('inlineblock').addClass('hidden'); $input.addClass('error'); $input.attr('title', msg); $input.tooltip({placement: 'bottom', trigger: 'manual'}); diff --git a/core/js/tests/specs/sharedialoglinkshareview.js b/core/js/tests/specs/sharedialoglinkshareview.js index b7144d3194..811919b560 100644 --- a/core/js/tests/specs/sharedialoglinkshareview.js +++ b/core/js/tests/specs/sharedialoglinkshareview.js @@ -121,7 +121,7 @@ describe('OC.Share.ShareDialogLinkShareView', function () { expect($workingIcon.hasClass('hidden')).toBeFalsy(); expect(shareModel.saveLinkShare.withArgs({ password: 'myPassword' }).calledOnce).toBeTruthy(); - shareModel.saveLinkShare.yieldTo("success", [shareModel]); + shareModel.saveLinkShare.yieldTo("complete", [shareModel]); expect($workingIcon.hasClass('hidden')).toBeTruthy(); }); @@ -132,6 +132,7 @@ describe('OC.Share.ShareDialogLinkShareView', function () { expect($workingIcon.hasClass('hidden')).toBeFalsy(); expect(shareModel.saveLinkShare.withArgs({ password: 'myPassword' }).calledOnce).toBeTruthy(); + shareModel.saveLinkShare.yieldTo("complete", [shareModel]); shareModel.saveLinkShare.yieldTo("error", [shareModel, "The error message"]); expect($workingIcon.hasClass('hidden')).toBeTruthy();