Hi Gil,

The onEnd event is used to signify the end of the dragg.
So it is fired at the end of dragg, then the revert take place and
move element to its original position.

here is a small test base on droppable test. I just add the onEnd
callback to the draggable, and you will see when it will be fired !

<style type="text/css">
  div#droppable_container {
    height: 140px;
    width: 400px; }
  div#draggable_demo {
    width: 60px;
    height: 60px;
    cursor: move;
    background: #9fcfba;
    border: 1px solid #666;
    text-align: center;
    position: relative;
    top: 30px;
    line-height: 50px; }
  div#droppable_demo {
    width: 160px;
    height: 120px;
    background: #fff;
    border: 5px solid #ccc;
    text-align: center;
    position: relative;
    top: -60px;
    left: 140px;
    line-height: 100px; }
  div#droppable_demo.hover {
    border: 5px dashed #aaa;
    background:#efefef; }
</style>

<div class="demo" id="droppable_container">
  <div id="draggable_demo" class="draggable">
    Drag me!
  </div>

  <div id="droppable_demo">
    Drop here!
  </div>
</div>

<script type="text/javascript">
  new Draggable('draggable_demo', {
    onEnd: function(){ alert('onEnd'); },  //THE ONEND CALLBACK
    revert: true
  });

  Droppables.add('droppable_demo', {
    accept: 'draggable',
    hoverclass: 'hover',
    onDrop: function() { $('droppable_demo').highlight(); }
  });
</script>

</body>
</html>

--
david

On 9 juin, 15:06, Gil <frog2...@gmail.com> wrote:
> Hi guys,
>
> While hacking draggables to add a new revert feature (which works
> exactly like the opposite of revert: failure) I was wondering if, when
> a revert option is set for a draggable, the onEnd event should be
> triggered or not ...
>
> I may understand the revert option in a different way than expected
> but, in my opinion, the revert is the only way so far to allow a
> "cancel" auto-feature depending on the revert option. Therefore, if a
> draggable is reverted, it means it is send back to its original
> position. Then why would we fire the onEnd event ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to