You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`compose`** - When a new compose window is opened, or a message is replied to or forwarded
212
212
-**`recipient_change`** - When an email being written (either new compose, reply or forward) has its to, cc or bcc recipients updated
213
213
-**`view_thread`** - When a conversation thread is opened to read
214
-
-**`view_email`** - Sub-observer to `view_thread`. When an individual email is loaded within a conversation thread.
214
+
-**`view_email`* - When an individual email is loaded within a conversation thread.
215
215
It's worth noting this event is only triggered when the email is actually rendered in the DOM. Gmail tends to cache the rendered emails, so it should not be expected to fire reliably for every viewing of the same email. It will most likely fire once, for the initial and possibly only rendering.
216
-
-**`load_email_menu`** - Sub-observer to `view_thread`. When the dropdown menu next to the reply button is clicked
216
+
-**`load_email_menu`** - When the dropdown menu next to the reply button is clicked
- gmail.observe**.bind(type, action, callback)** - implements the on, after, before callbacks
@@ -854,32 +854,15 @@ Your callback will be fired directly after Gmail's XMLHttpRequest has been sent
854
854
855
855
The on method also supports observering specific DOM events in the Gmail Interface (for example when a new compose window is opened). These are only available via the `on` method (not the `before` or `after` methods).
856
856
857
-
Some actions/observers also have defined 'sub-observers' which only (!) become available if you have an action bound to the parent observer. Sub-observers are defined as such because they only make sense once the parent has been triggered. I.e. for an individual email (or several emails) to display as part of a conversation thread, the thread must first be opened/loaded in the interface.
858
-
859
-
Example usage:
860
-
861
-
```js
862
-
gmail.observe.on('view_thread', function(obj) {
863
-
console.log('view_thread', obj);
864
-
});
865
-
866
-
// now we have access to the sub observers
867
-
and load_email_menu
868
-
gmail.observe.on('view_email', function(obj) {
869
-
console.log('view_email', obj);
870
-
});
871
-
```
872
-
873
-
**Available DOM Actions/Observers & Sub-observers**
857
+
**Available DOM Actions/Observers**
874
858
875
859
-**load** - When the gmail interface has completed loading
876
860
-**compose** - When a new compose window opens, or a message is replied to or forwarded
877
861
-**compose_cancelled** - When an existing compose window is closed.
878
862
-**recipient_change** - When the recipient (to, cc or bcc) is changed when composing a new email or replying/forwarding an email
879
863
-**view_thread** - When a new coversation thread is opened
880
-
-**view_thread Sub-observers**
881
-
-**view_email** - When an individual email is loaded within a thread (also fires when thread loads displaying the latest email)
882
-
-**load_email_menu** - When the dropdown menu next to the reply button is clicked
864
+
-**view_email** - When an individual email is loaded within a thread (also fires when thread loads displaying the latest email)
865
+
-**load_email_menu** - When the dropdown menu next to the reply button is clicked
0 commit comments