Skip to content

Add option to force placeholder height from item#78

Closed
Aaron-P wants to merge 1 commit intojohnny:masterfrom
Aaron-P:master
Closed

Add option to force placeholder height from item#78
Aaron-P wants to merge 1 commit intojohnny:masterfrom
Aaron-P:master

Conversation

@Aaron-P
Copy link

@Aaron-P Aaron-P commented Mar 19, 2014

Adds the option to force the placeholder to use the height of the dragged item.

@Quatoor
Copy link

Quatoor commented Apr 3, 2014

Please add this:

// This is executed after the placeholder has been moved.
@->    afterMove: function ($placeholder, container) Line 49
@+>    afterMove: function ($placeholder, container, item)...
movePlaceholder: function  (container, item, method, sameResultBox) { Line 321
      var lastAppendedItem = this.lastAppendedItem
      if(!sameResultBox && lastAppendedItem && lastAppendedItem[0] === item[0])
        return;
      item[method](this.placeholder)
      this.lastAppendedItem = item
      this.sameResultBox = sameResultBox
      @->  this.options.afterMove(this.placeholder, container)
      @+>  this.options.afterMove(this.placeholder, container, this.item)
}
<style> li.placeholder { margin: 5px!important; padding: 5px!important; border: 1px dashed #999!important } </style>

for ex:

afterMove: function (placeholder, container, item) {
            $(placeholder).height(item.height());
            or
            $(placeholder).height(item.outerHeight());
...

@johnny
Copy link
Owner

johnny commented Apr 19, 2014

just save the currently dragged item inside the onDragStart callback.

@johnny johnny closed this Apr 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants