diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-04-04 16:37:25 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-04-04 16:37:25 +0800 |
commit | 0aad073202331606a94d74dabd8a6beb72253a4a (patch) | |
tree | e204415721134fbd06f169791f7db3151ff294fa /mail | |
parent | 66e345e4752d3acdc3ddad21eb538a48a774b423 (diff) | |
download | gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.tar gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.tar.gz gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.tar.bz2 gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.tar.lz gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.tar.xz gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.tar.zst gsoc2013-evolution-0aad073202331606a94d74dabd8a6beb72253a4a.zip |
EMailDisplay: Install HTML click event handlers on images in all frames
The handlers were installed just on main frame. Thus if subframe
contained +/- images to show/hide i.e. CC'ed people it was not working.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-display.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 82dd8e999e..837c9b3892 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -887,26 +887,14 @@ initialize_web_view_colors (EMailDisplay *display) } static void -setup_dom_bindings (GObject *object, - GParamSpec *pspec, - gpointer user_data) +setup_image_click_event_listeners_on_document (WebKitDOMDocument *document, + WebKitWebView *web_view) { - WebKitWebView *web_view; - WebKitWebFrame *frame; - WebKitLoadStatus load_status; - WebKitDOMDocument *document; + gint length, ii = 0; WebKitDOMElement *button; WebKitDOMNodeList *list; - gint length, ii = 0; - - frame = WEBKIT_WEB_FRAME (object); - load_status = webkit_web_frame_get_load_status (frame); - if (load_status != WEBKIT_LOAD_FINISHED) - return; - - web_view = webkit_web_frame_get_web_view (frame); - document = webkit_web_view_get_dom_document (web_view); + /* Install event listeners on document */ button = webkit_dom_document_get_element_by_id ( document, "__evo-collapse-headers-img"); if (button != NULL) @@ -930,6 +918,18 @@ setup_dom_bindings (GObject *object, } static void +setup_dom_bindings (WebKitWebView *web_view, + WebKitWebFrame *frame, + gpointer user_data) +{ + WebKitDOMDocument *document; + + document = webkit_web_frame_get_dom_document (frame); + + setup_image_click_event_listeners_on_document (document, web_view); +} + +static void mail_parts_bind_dom (GObject *object, GParamSpec *pspec, gpointer user_data) @@ -1526,6 +1526,12 @@ e_mail_display_init (EMailDisplay *display) g_signal_connect ( display, "notify::uri", G_CALLBACK (mail_display_uri_changed), NULL); + g_signal_connect ( + display, "document-load-finished", + G_CALLBACK (setup_dom_bindings), NULL); + g_signal_connect ( + display, "document-load-finished", + G_CALLBACK (initialize_web_view_colors), NULL); display->priv->settings = g_settings_new ("org.gnome.evolution.mail"); g_signal_connect_swapped ( @@ -1543,13 +1549,7 @@ e_mail_display_init (EMailDisplay *display) main_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (display)); g_signal_connect ( main_frame, "notify::load-status", - G_CALLBACK (setup_dom_bindings), NULL); - g_signal_connect ( - main_frame, "notify::load-status", G_CALLBACK (mail_parts_bind_dom), NULL); - g_signal_connect ( - display, "document-load-finished", - G_CALLBACK (initialize_web_view_colors), NULL); actions = e_web_view_get_action_group (E_WEB_VIEW (display), "mailto"); gtk_action_group_add_actions ( |