/
taskwatermark.js
38 lines (34 loc) · 1.17 KB
/
taskwatermark.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* TaskWatermark plugin script
*
* @licstart The following is the entire license notice for the
* JavaScript code in this file.
*
* Copyright (C) Philip Weir
*
* The JavaScript code in this page is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* @licend The above is the entire license notice
* for the JavaScript code in this file.
*/
rcube_webmail.prototype.taskwatermark_enable = function () {
var lock = this.set_busy(true, 'loading');
this.http_post('plugin.taskwatermark.enable', {}, lock);
};
$(document).ready(function () {
if (window.rcmail) {
var afterlist = false;
rcmail.addEventListener('afterlist', function () {
afterlist = true;
});
rcmail.addEventListener('listupdate', function () {
if (afterlist && rcmail.env.display_first && $('#' + rcmail.env.contentframe).is(':visible')) {
rcmail.message_list.select_first();
afterlist = false;
}
});
}
});