calendar: Close messages on clear

Currently the clear action in the section header simply removes all
messages from the section. While the result looks exactly as if the
close button of each individual message had been clicked, the messages
are not actually closed - after a restart (or some other condition that
triggers a reload), the messages simply reappear, which is confusing.
Do the expected thing instead, and make clear close all messages in the
section.

https://bugzilla.gnome.org/show_bug.cgi?id=746027
This commit is contained in:
Florian Müllner 2015-03-11 22:20:21 +01:00
parent b61cb92053
commit e4ad31a5dd

View File

@ -1382,8 +1382,9 @@ const MessageListSection = new Lang.Class({
// If there are few messages, letting them all zoom out looks OK
if (messages.length < 2) {
messages.forEach(Lang.bind(this, function(message) {
this.removeMessage(message, true); }));
messages.forEach(function(message) {
message.close();
});
} else {
// Otherwise we slide them out one by one, and then zoom them
// out "off-screen" in the end to smoothly shrink the parent
@ -1397,9 +1398,9 @@ const MessageListSection = new Lang.Class({
time: MESSAGE_ANIMATION_TIME,
delay: i * delay,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this.removeMessage(message, true);
})});
onComplete: function() {
message.close();
}});
}
}
},