fixed taglist focus and click events to adhere to new event signature

This commit is contained in:
Ralf Becker 2013-10-09 17:29:36 +00:00
parent a6b3fb95c0
commit be0530936c
2 changed files with 18 additions and 10 deletions

View File

@ -178,20 +178,22 @@ var et2_taglist = et2_selectbox.extend(
} }
// onClick - pass more than baseWidget, so unbind it to avoid double callback // 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") this.div.unbind("click.et2_baseWidget")
.on("click.et2_baseWidget", '.ms-sel-item', jQuery.proxy(function(event) { .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 // 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)); },this));
} }
// onFocus // 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; return true;
}, },

View File

@ -1049,8 +1049,11 @@ app.mail = AppJS.extend(
/** /**
* User clicked an address (FROM, TO, etc) * 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); console.log(this, arguments);
}, },
@ -1436,17 +1439,20 @@ app.mail = AppJS.extend(
{ {
this.et2_obj.submit(); 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() sieve_vac_all_aliases: function()
{ {
var addr = this.et2.getWidgetById('addresses'); var addr = this.et2.getWidgetById('addresses');
console.log('say something'); console.log('say something');