diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-04-15 18:35:33 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-04-15 18:35:33 +0200 |
commit | a2e09c950d8716346b151f7980df1b51ebfbdd78 (patch) | |
tree | a521a31893a190038d95bbcdfb13085255309d14 /plugins/managesieve | |
parent | a5f8c8307a9e4059dad2833712b9a612631a36ed (diff) |
Use methods chaining, don't use deprecated row_init method
Diffstat (limited to 'plugins/managesieve')
-rw-r--r-- | plugins/managesieve/managesieve.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index 46ebc92de..22d57e159 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -72,22 +72,25 @@ if (window.rcmail) { if (rcmail.gui_objects.filterslist) { rcmail.filters_list = new rcube_list_widget(rcmail.gui_objects.filterslist, {multiselect:false, draggable:true, keyboard:false}); - rcmail.filters_list.addEventListener('select', function(e) { p.managesieve_select(e); }); - rcmail.filters_list.addEventListener('dragstart', function(e) { p.managesieve_dragstart(e); }); - rcmail.filters_list.addEventListener('dragend', function(e) { p.managesieve_dragend(e); }); - rcmail.filters_list.row_init = function (row) { - row.obj.onmouseover = function() { p.managesieve_focus_filter(row); }; - row.obj.onmouseout = function() { p.managesieve_unfocus_filter(row); }; - }; - rcmail.filters_list.init(); - rcmail.filters_list.focus(); + + rcmail.filters_list + .addEventListener('select', function(e) { p.managesieve_select(e); }) + .addEventListener('dragstart', function(e) { p.managesieve_dragstart(e); }) + .addEventListener('dragend', function(e) { p.managesieve_dragend(e); }) + .addEventListener('initrow', function(row) { + row.obj.onmouseover = function() { p.managesieve_focus_filter(row); }; + row.obj.onmouseout = function() { p.managesieve_unfocus_filter(row); }; + }) + .init().focus(); } if (rcmail.gui_objects.filtersetslist) { - rcmail.filtersets_list = new rcube_list_widget(rcmail.gui_objects.filtersetslist, {multiselect:false, draggable:false, keyboard:false}); - rcmail.filtersets_list.addEventListener('select', function(e) { p.managesieve_setselect(e); }); - rcmail.filtersets_list.init(); - rcmail.filtersets_list.focus(); + rcmail.filtersets_list = new rcube_list_widget(rcmail.gui_objects.filtersetslist, + {multiselect:false, draggable:false, keyboard:false}); + + rcmail.filtersets_list + .addEventListener('select', function(e) { p.managesieve_setselect(e); }) + .init().focus(); if (set != null) { set = rcmail.managesieve_setid(set); |