From be0530936c7f0ffd5e74aba377a4b5ba20f2bdb4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 9 Oct 2013 17:29:36 +0000 Subject: [PATCH] fixed taglist focus and click events to adhere to new event signature --- etemplate/js/et2_widget_taglist.js | 12 +++++++----- mail/js/app.js | 16 +++++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/etemplate/js/et2_widget_taglist.js b/etemplate/js/et2_widget_taglist.js index 8a56980fed..0923094e94 100644 --- a/etemplate/js/et2_widget_taglist.js +++ b/etemplate/js/et2_widget_taglist.js @@ -178,20 +178,22 @@ var et2_taglist = et2_selectbox.extend( } // onClick - pass more than baseWidget, so unbind it to avoid double callback - if(this.options.onclick) + if(typeof this.onclick == 'function') { this.div.unbind("click.et2_baseWidget") .on("click.et2_baseWidget", '.ms-sel-item', jQuery.proxy(function(event) { - var widget = this; // Pass the target as expected, but also the data for that tag - this.click(event.target, $j(event.target).parent().data("json")); + this.click(/*event.target,*/ $j(event.target).parent().data("json")); },this)); } // onFocus - if (this.options.onfocus) + if (typeof this.onfocus == 'function') { - $j(this.taglist).on("focus", jQuery.proxy(this.focus,this)); + var widget = this; + $j(this.taglist).focus(function(e) { + widget.onfocus.call(widget.taglist, e, widget); + }); } return true; }, diff --git a/mail/js/app.js b/mail/js/app.js index 2132d4efb3..9d3f989c89 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -1049,8 +1049,11 @@ app.mail = AppJS.extend( /** * User clicked an address (FROM, TO, etc) + * + * @param object tag_info with values for attributes id, label, title, ... + * @param et2_taglist widget */ - address_click: function(DOMNode, tag_info, widget) + address_click: function(tag_info, widget) { console.log(this, arguments); }, @@ -1436,17 +1439,20 @@ app.mail = AppJS.extend( { this.et2_obj.submit(); }, - - sieve_editRules_radiobtn: function() + + /** + * Focus handler for folder, address, reject textbox/taglist to automatic check associated radio button + */ + sieve_focus_radioBtn: function(_ev, _widget) { - console.log("hi i am radiobtn"); + _widget.getRoot().getWidgetById('action').set_value(_widget.id.replace(/^action_([^_]+)_text$/, '$1')); }, + /** * */ sieve_vac_all_aliases: function() { - var addr = this.et2.getWidgetById('addresses'); console.log('say something');