I'm writing a custom redactor plugin and I need to pass in this
into a jquery .change event. How can I get the following to work?
(function($R)
{
$R.add('plugin', 'customplugin', {
onmodal: {
image: {
open: function($modal, $form)
{
this._load($modal)
}
}
},
_load: function($modal)
{
var $body = $modal.getBody();
this.$box = $R.dom('<div>');
this._getData('hello world'); //This works
$('.item').change(function (this) { //'this' passed in here
var value = $(this).val();
this._getFoo(value); //This does not work
return false;
}).keyup(function () {
$(this).change();
});
},
_getFoo: function(param) {
console.log('_getFoo() called with param ' + param);
},
});
})(Redactor);