Privly button appears in forms and creates a ZeroBin post

Known issues:
- the button only appears in textareas and editable divs so this means it will appear in Google Translate and any other such contexts witch can be frustrating.
- the positioning of the button is not consistent especially in G+, where if the chat window is re-sized the button loses its position.   
I'm not saying you should remove the lines, I am saying it would be clearer if you reorder them. You don't need to add it to the dom until it is fully constructed. Then immediately after adding it to the dom you start the opacity transition.

> On Jun 25, 2014, at 10:18 AM, Vlad Fulgeanu <notifications@github.com> wrote:
> 
> In javascripts/content_scripts/post_new_link.js:
> 
> > +var context, offsets, width;
> > +
> > +// Use JavaScript event delegation functionality to attach a click event to 
> > +// every textarea and editable div on page
> > +document.body.addEventListener( "click", function(evt) {
> > +  if(evt.target && 
> > +    (evt.target.nodeName == "TEXTAREA" || 
> > +    (evt.target.nodeName == "DIV" && evt.target.getAttribute("contenteditable")))) {
> > +
> > +    // The button can now be click-able
> > +    span.style.cursor = "pointer";
> > +    // Save the current context
> > +    context = evt.target;   
> > +
> > +    evt.target.parentNode.style.position = "relative";
> > +    evt.target.parentNode.insertBefore(div, evt.target);
> But I am doing that, all that I am doing inside the click event is saving the context, positioning the button, and doing the transition effect (lines 52, 59, 60 are all needed for the desired transition effect).
> 
> —
> Reply to this email directly or view it on GitHub.