]> source.dussan.org Git - jquery-ui.git/commitdiff
sortable: option dropOnEmpty wasn't working correctly - in fact, you could always...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Mon, 26 May 2008 09:10:48 +0000 (09:10 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Mon, 26 May 2008 09:10:48 +0000 (09:10 +0000)
ui/source/ui.sortable.js

index 4c5e00d35ad5255271660b93e587b0c940a7b732..4fddc310f5b4ee38a1faf1caf184a17b4291412e 100644 (file)
                        return false;\r
                        \r
                },\r
-               //This method checks approximately if the item is dragged in a container, but doesn't touch any items\r
-               inEmptyZone: function(container) {\r
-\r
-                       if(!$(container.options.items, container.element).length) {\r
-                               return container.options.dropOnEmpty ? true : false;\r
-                       };\r
-\r
-                       var last = $(container.options.items, container.element).not('.ui-sortable-helper'); last = $(last[last.length-1]);\r
-                       var top = last.offset()[this.floating ? 'left' : 'top'] + last[0][this.floating ? 'offsetWidth' : 'offsetHeight'];\r
-                       return (this.position.absolute[this.floating ? 'left' : 'top'] > top);\r
-               },\r
                refresh: function() {\r
                        this.refreshItems();\r
                        this.refreshPositions();\r
                                                                }\r
                                                        }\r
                                                        \r
+                                                       if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled\r
+                                                               continue;\r
+                                                       \r
                                                        //We also need to exchange the placeholder\r
                                                        if(this.placeholder) this.placeholder.remove();\r
                                                        if(this.containers[i].options.placeholder) {\r
                        delay: 0,\r
                        cancel: ":input,button",\r
                        items: '> *',\r
-                       zIndex: 1000\r
+                       zIndex: 1000,\r
+                       dropOnEmpty: true\r
                }\r
        });\r
 \r