0 Replies - 1446 Views - Last Post: 13 May 2013 - 04:03 PM

#1 Gamegoofs2   User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 159
  • Joined: 15-April 09

Draggable Element Disappears after Dialog

Posted 13 May 2013 - 04:03 PM

I'm trying to use the draggable/sortable effect to add a new element to a list and then open a dialog window asking for a name for it. What happens though is after the dialog closes the newly created element disappears.

$(function() {
      $( "#sortable" ).sortable({
        revert: true
      });
      $( "#draggable" ).draggable({
        connectToSortable: "#sortable",
        helper: "clone",
        revert: "invalid",
        stop: function(event, ui) {
          $("#dialog").dialog('open');
        }
      });
      $( "ul, li" ).disableSelection();
    });
    $(function() {
      $("#dialog").dialog({
        autoOpen: false,
        height: 150,
        width: 200,
        modal: true
      });
    });
    function changeTitle() {
      var boxText = $("#newsTitle").val();
      $(".ui-draggable").text(boxText);
      $(".ui-state-default").removeClass('ui-draggable');
    }


I think I've narrowed it down to having something do with when the dialog returns. Any ideas?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1