Use "showTemporary" instead of explicitly hiding the notification
"OC.Notification.hide" expects the notification to be hidden to be passed as an argument. As it was being used to show a temporary notification the combination of "OC.Notification.show" and "OC.Notification.hide" was replaced by a single call to "OC.Notification.showTemporary". The timeout could have been specified in the options of the call, but it was left to the default value (7 seconds) for consistency with other notifications. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
fcef15af80
commit
ed1452d7a0
|
@ -334,8 +334,7 @@
|
||||||
$loading.addClass('hidden');
|
$loading.addClass('hidden');
|
||||||
$loading.removeClass('inlineblock');
|
$loading.removeClass('inlineblock');
|
||||||
$confirm.removeClass('hidden');
|
$confirm.removeClass('hidden');
|
||||||
OC.Notification.show(t('core', 'An error occurred. Please try again'));
|
OC.Notification.showTemporary(t('core', 'An error occurred. Please try again'));
|
||||||
window.setTimeout(OC.Notification.hide, 5000);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -472,14 +472,14 @@ describe('OC.Share.ShareDialogView', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('autocompletion of users', function() {
|
describe('autocompletion of users', function() {
|
||||||
var showNotificationStub;
|
var showTemporaryNotificationStub;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
showNotificationStub = sinon.stub(OC.Notification, 'show');
|
showTemporaryNotificationStub = sinon.stub(OC.Notification, 'show');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
showNotificationStub.restore();
|
showTemporaryNotificationStub.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('triggers autocomplete display and focus with data when ajax search succeeds', function () {
|
describe('triggers autocomplete display and focus with data when ajax search succeeds', function () {
|
||||||
|
@ -1486,7 +1486,7 @@ describe('OC.Share.ShareDialogView', function() {
|
||||||
dialog.render();
|
dialog.render();
|
||||||
dialog.autocompleteHandler({term: 'bob'}, sinon.stub());
|
dialog.autocompleteHandler({term: 'bob'}, sinon.stub());
|
||||||
fakeServer.requests[0].respond(500);
|
fakeServer.requests[0].respond(500);
|
||||||
expect(showNotificationStub.calledOnce).toEqual(true);
|
expect(showTemporaryNotificationStub.calledOnce).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('renders the autocomplete elements', function() {
|
describe('renders the autocomplete elements', function() {
|
||||||
|
|
Loading…
Reference in New Issue