0

I am trying to edit jeditable js in order to add some functionality I have my own onblur() function. what i want to do is to close new jeditable if already one is opend

my code is :

t = setTimeout(function() {
     var focusedElem=$(document.activeElement);
         if(focusedElem.is("textarea"){
        **//what should i write in order to cancel the new one 
             $(e.target).focus(); //return the focus to the old one
         }
         else
             reset.apply(form, [settings, self]);
           }, 500);

I am trying to make the code generic and user friendly, thats why i dont want any user that use my plugin to write id for each element. so please dont give answers that use id.

i have tried to write the following raws but any of them is making error reset.apply(form, [settings, focusedElem]); reset.apply(form, [settings, $(focusedElem)]);

more than that i don't want to trigger on a cancel button (maybe he is not want to add it(user friendly))

4

0 回答 0