Getting the file browser twice
<p>I have a little application which can be found here: <a href="http://templater.pmueller.dev.xiag.ch/frontend/show/id/3/authkey/789" rel="nofollow">templater.pmueller.dev.xiag.ch/frontend/show/id/3/authkey/789</a> If the site is down, try again in an hour. They are experiencing problems atm. Also everything is quite beta and it's my first bigger jQuery project.</p>

<p>If you drag an element from the left to the right, you can double click on the left handed little images as well as on the text.</p>

<p>My problem is that if i double click on the images, the code gets called twice. If you don't experience this, reload the page. Normally, a newly added element doesn't show this problem, but as soon as you reload, the bug is there.</p>

<p>My guess is some messed up event handlers, but I'm too new for debugging that correctly.</p>

<p>Here are some code snippets:</p>

<p>jquery.InlineEditor.js</p>

<pre><code>   $(this).on("dblclick", '.editor-img', function() {
       if($(this).is('img')) {
           $("#imgUpload").attr('action', '/frontend/upload/width/' + $(this).width() + '/height/' + $(this).height());
           $('#imageInput').click();
           $('body').data('clickedElement', this);
       }
   });
</code></pre>

<p>I also thought of just unbind the event before i bind it again, but I really want to know what to do and how a nice solution to this problem looks like.</p>

<p>Thanks</p>
