var drop_handler = function() {

  var item_position = "";

  item_position = "&item_position=" + jQuery(this).parent().children().filter('li').index(this)

  var item_id = this.attr("id").substr(1);
  var lane_id = this.parent().attr("id").substr(1);

  var startchar = "?"
  if (window.location.href.indexOf("?") != -1) startchar = "&"

  Hobo.ajaxRequest( window.location.href + startchar + "lane_id=" + lane_id + "&item_id=" + item_id + item_position,
                    [],
                    { params: { lane_id: lane_id, item_id: item_id },
                      action: 'show',
                      controller: 'projects',
                      method: 'get',
                      message: "Please wait"
                    } );
}

var get_item_details = function(board, item_id) {
  Hobo.ajaxRequest( "/items/" + item_id + "/ajax_item",
                    [],
                    { params: { item_id: item_id },
                      action: 'ajax_item',
                      controller: 'items',
                      method: 'get',
                      message: "Please wait",

                      onSuccess: function(transport) {
                        jQuery("#edit-item-dialog").empty();
                        jQuery("#edit-item-dialog").append(transport.responseText);

                        jQuery("#edit-item-dialog").find('.hjq-annotated').each(function() {
                          var annotations = hjq.getAnnotations.call(this);
                          if (annotations.init) {
                            hjq.util.createFunction(annotations.init).call(this, annotations);
                          };
                        });

                        hjq.dialog_opener.click(this, jQuery('#item-dialog-s' + item_id));
                      },

                      onFailure: function(transport) {
                        jQuery("#edit-item-dialog").empty();
                      }
                    } );
}

jQuery("#cl-toggle").click( function() {
  this.value = jQuery("#change-log").is(':visible') ? "Change Log" : "Hide Change Log";
  jQuery("#change-log").toggle();
});

var laneheight = window.innerHeight - (jQuery('.navigation').height() * 4) - jQuery('.timeline').height();
if (laneheight < 300) laneheight = 300;
laneheight = laneheight + "px";
jQuery(".kb-lane").css("height", laneheight);

jQuery(".kb-lane",".board").dragsort({ dragBetween: true, dragEnd: drop_handler});
jQuery(".lane-count").text(function () { return jQuery(this).parent().parent().parent().children().size() - 1;});

@@ -1,12 +1,171 @@
+var count_cards = function () %7B%0A%0A  jQuery(%22.lane-count%22).text(function () %7B%0A    return jQuery(this).parent().parent().parent().children().size() - 1;%0A  %7D);%0A%7D%0A%0A
 var drop_han
@@ -893,16 +893,34 @@
    %7D );%0A
+  count_cards ();%0A
 %7D%0A%0Avar g
@@ -2604,118 +2604,19 @@
 %7D);%0A
-jQuery(%22.lane-count%22).text(function () %7B return jQuery(this).parent().parent().parent().children().size() - 1;%7D
+count_cards(
 );%0A

update task counts for lanes on drag n drop: fixes S1707