Use "complete" callback in onPasswordEntered
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
e0b0115f99
commit
58cc1251be
|
@ -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'});
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue