[Jifty-commit] jifty branch, jquery_with_ui, updated. 9f805c8ab7af1f24a93b30ec0d1c1087e9ed1039

Jifty commits jifty-commit at lists.jifty.org
Wed Jan 27 07:28:27 EST 2010


The branch, jquery_with_ui has been updated
       via  9f805c8ab7af1f24a93b30ec0d1c1087e9ed1039 (commit)
      from  2c51572197ff53e38823467f9c91239416d56ca4 (commit)

Summary of changes:
 share/web/static/js/ordered-list.js |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 9f805c8ab7af1f24a93b30ec0d1c1087e9ed1039
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jan 27 20:28:18 2010 +0800

    tweak ordered-list.js

diff --git a/share/web/static/js/ordered-list.js b/share/web/static/js/ordered-list.js
index 049fc68..e91c541 100644
--- a/share/web/static/js/ordered-list.js
+++ b/share/web/static/js/ordered-list.js
@@ -1,20 +1,23 @@
 jQuery(document).ready(function(){
-    jQuery("div.ordered-list-container ul.unselected").sortable({
-        connectWith: 'ul.selected',
-        cancel: 'li.head'
+    jQuery("div.ordered-list-container").each(
+        function () {
+        var box = jQuery(this);
+        box.find('ul.unselected').sortable( {
+            connectWith: box.find('ul.selected'),
+            cancel: 'li.head'
+            });
+        box.find('ul.selected').sortable( {
+            connectWith: box.find('ul.unselected'),
+            cancel: 'li.head',
+            update: function () {
+                var select = box.find('select.submit');
+                select.children('option').remove();
+                jQuery(this).find('li:not(.head)').each( function() {
+                    var value = jQuery(this).find('input.value').val();
+                    jQuery('<option selected="selected" value="' + value + '" >' + value + '</option>').appendTo(select);
     });
-
-    jQuery("div.ordered-list-container ul.selected").sortable({
-        connectWith: 'ul.unselected',
-        cancel: 'li.head',
-        update: function () {
-            var box = jQuery(this).parents('div.ordered-list-container');
-            var select = box.find('select.submit');
-            select.children('option').remove();
-            jQuery(this).find('li:not(.head)').each( function() {
-                var value = jQuery(this).find('input.value').val();
-                jQuery('<option selected="selected" value="' + value + '" >' + value + '</option>').appendTo(select);
-    });
-        }
+            }
+            });
     });
+
 });

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list