From e4ad31a5ddec3a9cca839e7a2cf86edfb5145dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 11 Mar 2015 22:20:21 +0100 Subject: [PATCH] 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 --- js/ui/calendar.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/ui/calendar.js b/js/ui/calendar.js index dda733c7c..93d5e7d3b 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -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(); + }}); } } },