Use "complete" callback in onPasswordEntered

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2017-04-24 22:18:52 +02:00
parent e0b0115f99
commit 58cc1251be
2 changed files with 3 additions and 3 deletions

View File

@ -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'});

View File

@ -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();