layerssss / paste.js

read image/text data from clipboard (cross-browser)
http://layerssss.github.io/paste.js/
MIT License
463 stars 94 forks source link

When pasting anything, I get every output 13x to console.log #13

Closed jmuheim closed 9 years ago

jmuheim commented 9 years ago

When pasting anything, I get every output 13x to console.log. The text "getrennte" was pasted once and output 13x:

image

Is this correct? What could be the problem?

jmuheim commented 9 years ago

Yeah, what a nice coincidence: this is issue number 13! :laughing:

layerssss commented 9 years ago

no way, I cannot reproduce the problem, can you make a simple jsfiddle or gist to demonstrate the problem? that would be really helpful! :smile:

jmuheim commented 9 years ago

It seems to have to do with the $('*') selector from the example:

  $('*').on('pasteImage', (ev, data) ->
    # ...

It seems to somehow traverse all the parent nodes of the textarea and appends the <div> to each node.

When doing

  $('textarea#boilerplate_intro').on('pasteImage', (ev, data) ->
    # ...

it seems to work. But I don't want to specify a fixed ID, I want to target all the textareas I have.

If this doesn't help yet, I will create a CodePen for it.