okbreathe/jquery_plugins — Issue #7: disableInInput disables tag "a" along with "input" and "textarea"
Author: al222
Created: 2012-02-13 12:26:22+00:00
State: open

Hello,

Firstly thank you for your good work, the plugin works fine.

I did however found one bug: when you set disableInInput option to true, tag "a" is disabled as well, "a" being obviously included in "textarea".

I modified the triggeredInDisableTags function to enclose the tags between asterisks (*) and it seems to solve the problem.

Modified function (replace [asterisk] by an asterisk, I had to do this noticing that the "preview" was deleting most of them ?):

function triggeredInDisableTags(event, disableInInput) {
if (!disableInInput){
return false;
}
var disableTags = '[asterisk]textarea[asterisk]input[asterisk]';
var element = event.target || event.srcElement;
if (element.nodeType === 3) { element = element.parentNode; }
return (disableTags.toLowerCase().indexOf('[asterisk]'+element.tagName.toLowerCase()+'[asterisk]') >= 0) ? true : false;
}

I don't know if this is a clean or dirty fix ;) but I felt I had to share it.

Thanks again.