Search and Top Navigation
#4657 closed bug (fixed)
Opened July 05, 2009 03:21PM UTC
Closed August 22, 2009 01:44PM UTC
Last modified May 16, 2010 03:25PM UTC
Update docs, revert supports a number parameter for animation speed
Reported by: | crankharder | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8 |
Component: | ui.sortable | Version: | 1.7.2 |
Keywords: | revert | Cc: | |
Blocked by: | Blocking: |
Description
Should be self-explanatory:
I'd like to be able to control how fast an option reverts back to its position.
Should act like other jquery speed settings, slow, normal, fast (i think?) or an integer which represents milliseconds.
Attachments (0)
Change History (4)
Changed July 05, 2009 04:50PM UTC by comment:1
Changed July 05, 2009 04:55PM UTC by comment:2
Okay -- the docs explicitly state that revert takes a boolean, and the examples show true/false being passed in:
http://docs.jquery.com/UI/API/1.7/Sortable#option-revert
Based on the code above, taken from 1.7.2 that revert actually will take a number and convert that to the animation speed.
Passing revert:100 as an option confirms it as well.
I've no idea if tests support this, but it seems to work in practice...
Maybe somebody should update the docs to reflect that?
Changed July 09, 2009 02:26PM UTC by comment:3
milestone: | TBD → 1.8 |
---|---|
priority: | minor → major |
summary: | new sortable option: revertSpeed → Update docs, revert supports a number parameter for animation speed |
type: | enhancement → bug |
version: | → 1.7.2 |
Docs need to be updated.
Changed August 22, 2009 01:44PM UTC by comment:4
resolution: | → fixed |
---|---|
status: | new → closed |
Fixed!
I tracked this down to the animate() function inside of sortable here:
$(this.helper).animate({
left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
}, parseInt(this.options.revert, 10) || 500, function() {
self._clear(event);
});
The second param is: parseInt(this.options.revert, 10) || 500, which is the duration of the animation... I'm not sure what the parseInt part is trying to do, but if I replace that whole thing with a custom speed then I get the result I want. I don't think this can be set by some external option as of right now -- maybe it can??