Created
September 14, 2010 19:15
Revisions
-
malero revised this gist
Sep 14, 2010 . 2 changed files with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,6 @@ ul.sortable { padding-bottom: 5px; } ul.sortable li { cursor: pointer; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,13 @@ jQuery(function() { // Make all ul.sortable lists into sortable lists jQuery('ul.sortable').sortable({ tolerance: 'pointer', cursor: 'pointer', dropOnEmpty: true, connectWith: 'ul.sortable', update: function(event, ui) { if(this.id == 'sortable-delete') { // Remove the element dropped on #sortable-delete jQuery('#'+ui.item.attr('id')).remove(); } else { // Update code for the actual sortable lists -
malero revised this gist
Sep 14, 2010 . 3 changed files with 18 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,10 @@ width: 0; overflow: hidden; } ul.sortable { padding-bottom: 5px; } ul.sortable li { padding: 1px 0 1px 0; cursor: pointer; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,6 @@ <ul class="sortable"> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ jQuery(function() { jQuery('ul.sortable').sortable({ tolerance: 'pointer', cursor: 'pointer', dropOnEmpty: true, connectWith: 'ul.sortable', update: function(event, ui) { if(this.id == 'sortable-delete') { jQuery('#'+ui.item.attr('id')).remove(); } else { // Update code for the actual sortable lists } } }); }); -
malero created this gist
Sep 14, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #sortable-delete { height: 18px; overflow: hidden; background: url('/resources/img/bin.png') 0 50% no-repeat; } #sortable-delete li { height: 0; width: 0; overflow: hidden; } ul.checklist { padding-bottom: 5px; } ul.checklist li { padding: 1px 0 1px 0; cursor: pointer; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ <ul id="sortable-delete" class="sortable"></ul> <ul class="sortable"> <li>Item 1</li> <li>Item 2</li> </ul> <ul class="sortable"> <li>Item 3</li> </ul> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ jQuery('ul.sortable').sortable({ tolerance: 'pointer', cursor: 'pointer', dropOnEmpty: true, connectWith: 'ul.sortable', update: function(event, ui) { if(this.id == 'sortable-delete') { jQuery('#'+ui.item.attr('id')).remove(); } else { // Update code for the actual sortable lists } } });