[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/jquery_ui/jquery.ui/tests/visual/droppable/ -> droppable_ticket_4088.html (source)

   1  <!doctype html>
   2  <html lang="en">
   3  <head>
   4      <title>Droppable Visual Test - Droppable ticket 4088</title>
   5      <link type="text/css" href="../../../themes/base/ui.all.css" rel="stylesheet" />
   6      <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
   7      <script type="text/javascript" src="../../../ui/ui.core.js"></script>
   8      <script type="text/javascript" src="../../../ui/ui.sortable.js"></script>
   9      <script type="text/javascript" src="../../../ui/ui.droppable.js"></script>
  10      <link type="text/css" href="../demos.css" rel="stylesheet" />
  11      <style type="text/css">
  12      #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }

  13      #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }

  14      #sortable li span { position: absolute; margin-left: -1.3em; }

  15  
  16      #trash { width: 58%; height: 8em; padding: 1%; margin-top: 1%; }

  17      #trash h4 { line-height: 16px; margin: 0 0 0.4em; }

  18      #trash h4 .ui-icon { float: left; }

  19      </style>
  20      <script type="text/javascript">
  21      $(function() {
  22          $("#sortable").sortable();
  23          $("#trash").droppable({
  24              accept: '#sortable > li',
  25              activeClass: 'ui-state-highlight',
  26              drop: function(ev, ui) {
  27                  if (ui.draggable.is('#special')) {
  28                      setTimeout(function() { ui.draggable.remove(); }, 1);
  29                  } else {
  30                      ui.draggable.remove();
  31                      ui.draggable.html('<strong>I was dropped and removed, but still here I am!</strong>');
  32                  }
  33              }
  34          });
  35      });
  36      </script>
  37  </head>
  38  <body>
  39  
  40  <h1>
  41  Ticket <a href="http://dev.jqueryui.com/ticket/4088">#4088</a> - Unable to remove() ui.draggable (sortable item) immediately after the drop callback.
  42  </h2>
  43  <h2>
  44  TEST: Drag 'Special Item' to the div labelled 'Drop here'
  45  </h2>
  46  <h2>
  47  TEST: Drag a 'Normal Item' to the div labelled 'Drop here'
  48  </h2>
  49  
  50  <ul id="sortable">
  51      <li class="ui-state-default" id="special"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Special Item</li>
  52      <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Normal Item 1</li>
  53      <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Normal Item 2</li>
  54      <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Normal Item 3</li>
  55  </ul>
  56  
  57  <div id="trash" class="ui-widget-content ui-state-default">
  58      <h4 class="ui-widget-header"><span class="ui-icon ui-icon-trash">Trash</span> Drop here</h4>
  59  </div>
  60  
  61  <h3>
  62  ASSERT: The dropped item is removed from the original list and the following text does not appear: "<strong>I was dropped and removed, but still here I am!</strong>"
  63  </h3>
  64  
  65  </body>
  66  </html>


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7