[gnome-shell] calendar: Close messages on clear



commit e4ad31a5ddec3a9cca839e7a2cf86edfb5145dab
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Mar 11 22:20:21 2015 +0100

    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 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index dda733c..93d5e7d 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();
+                                   }});
             }
         }
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]