title: jQuery UI Drag and Drop causes bound click to trigger
body: <p>I've got a UL of items using jQuery UI that I have drag and drop capable. However, I also need to be able to click on one of the items in the list and trigger off a little routine that adds a header line above one of the "li"s. The problem lies with the click on the drag and drop. I've tried to bind the click to a specific region of the li using a span but then I lose the index of the li. Here's my code, any suggestions would be greatly appreciated:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   $(function() {
          var item_positions = $('#ml_organize').sortable('toArray');
    $('#ml_organize').sortable({
        placeholder: 'ui-state-highlight',
              cursor: 'pointer'
    });
    $('#ml_organize').disableSelection();
          $('#org_submit').click(function() {
              var item_positions = $('#ml_organize').sortable('toArray');
          });
          $('#ml_organize li').bind('click', function() {
              var rowNo = $(this).index();
              var newRow = "&lt;li id=\'li" + rowNo + "\' class=\'ui-state-default\'&gt;&lt;span class=\'icon ui-icon ui-icon-minusthick\' title=\'Remove header line\' alt=\'Remove header line\' onClick=\'removeMLRow(" + rowNo + ");\'&gt;&lt;/span&gt;&lt;span class=\'note\'&gt;HL&lt;/span&gt;&lt;input class=\'header_line\' maxlength=\'75\' type=\'text\' name=\'hl_text[" + rowNo + "]\' id=\'hl_text" + rowNo + "\' /&gt;&lt;/li&gt;";
              //alert(rowNo);
              $('#ml_organize li').eq(rowNo).before(newRow);
              $('#hl_text' + rowNo + '').focus(function() {
                  $(this).css('background','#DDD');
              });
              $('#hl_text' + rowNo + '').blur(function() {
                  $(this).css('background','#FFF');
              });
              $('#hl_text' + rowNo + '').focus();
              // renumber rows after insert
              $('#ml_organize li').slice(rowNo - 1).each(function() {
                  var newID = 'li' + ($(this).index() + 1);
                  $(this).attr('id',newID);
              });
              var item_positions = $('#ml_organize').sortable('toArray');
              // alert(item_positions);
          });
   });
      function removeMLRow(rowNo) {
          $('#ml_organize li').eq(rowNo).remove();
          // renumber rows after remove
          $('#ml_organize li').slice(rowNo).each(function() {
              var newID = 'li' + ($(this).index() + 1);
              $(this).attr('id',newID);
          });
          var item_positions = $('#ml_organize').sortable('toArray');
          //alert(item_positions);
      }
      $('#org_submit').button();
  &lt;/script&gt;
  </code></pre>
  
  <p>And here's the UL that it needs to manipulate:</p>
  
  <pre><code>&lt;ul id="ml_organize"&gt;
     &lt;li id="li1" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;2&lt;/span&gt;&lt;span class="org_partno"&gt;RFCH702&lt;/span&gt;&lt;span class="org_desc"&gt;HEAVY HARDWARES(PAIR) 2.0" STGR&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li2" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;2&lt;/span&gt;&lt;span class="org_partno"&gt;FBM26CB&lt;/span&gt;&lt;span class="org_desc"&gt;FLR BASE MLDINGX26" (CB VINYL)&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li3" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;2&lt;/span&gt;&lt;span class="org_partno"&gt;AFC2202DG&lt;/span&gt;&lt;span class="org_desc"&gt;AUX CHANNEL, 4Â¿&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li4" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;601343874&lt;/span&gt;&lt;span class="org_desc"&gt;UNI-STRUT KIT - ED8C509-50 G9 EQUIVALENT&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li5" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;4&lt;/span&gt;&lt;span class="org_partno"&gt;ISS888&lt;/span&gt;&lt;span class="org_desc"&gt;INSUL STRIP FOR BAYS-42" LONG&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li6" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;4&lt;/span&gt;&lt;span class="org_partno"&gt;ICS775&lt;/span&gt;&lt;span class="org_desc"&gt;INSUL CABLE RACK 1.5"STG 7.75"&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li7" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;2&lt;/span&gt;&lt;span class="org_partno"&gt;CJB6302C&lt;/span&gt;&lt;span class="org_desc"&gt;CLIP J-BOLT ASSM FOR 2"CR/FC&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li8" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;TR53&lt;/span&gt;&lt;span class="org_desc"&gt;5/8-11 THREADED ROD X  24.0"&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li9" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;MAS-NTWKBAYKIT&lt;/span&gt;&lt;span class="org_desc"&gt;FLOOR MNTG HARDWARE KIT (NTWK)&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li10" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;ESD1080740001&lt;/span&gt;&lt;span class="org_desc"&gt;ESD BANANA JACK&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li11" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;ESDSTRAP&lt;/span&gt;&lt;span class="org_desc"&gt;ADJ ELASTIC 63070&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li12" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;ESDLABEL&lt;/span&gt;&lt;span class="org_desc"&gt;GREEN .75" X 1.75" ESD LABEL&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li13" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;SPT6224&lt;/span&gt;&lt;span class="org_desc"&gt;SPLIT TUBE 5/8" X 24" GRAY&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li14" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;SAF2502&lt;/span&gt;&lt;span class="org_desc"&gt;FRAMING CLIP ASSM AUX CHNL 5/8&lt;/span&gt;&lt;/li&gt;
      &lt;li id="li15" class="ui-state-default"&gt;&lt;span class="icon ui-icon ui-icon-plusthick" title="Add header line" alt="Add header line"&gt;&lt;/span&gt;&lt;span class="org_qty"&gt;1&lt;/span&gt;&lt;span class="org_partno"&gt;T1523-0031-200&lt;/span&gt;&lt;span class="org_desc"&gt;28 PR/24AWG SHLD, AMP 64-PIN FEMALE CONN&lt;/span&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>