diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-19 03:51:29 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-19 03:51:29 +0000 |
commit | aaec040716d6e8702cbc001447f621e9a13a219c (patch) | |
tree | a4cdf85f4f3968c7463bd9e4c1160698afc0f235 /modules/organize/js | |
parent | a8d60021ea67bbb3a58f8214ae03a4f34f17119f (diff) |
- Improve the movement of the placeholder
- Make sure the thumbgrid will utoscroll when dragging
- And an ordinal attribute to the thumbnail when generated, based on the
current sort order of the album.
Diffstat (limited to 'modules/organize/js')
-rw-r--r-- | modules/organize/js/organize.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js index 6a2cc0d6..8f4fe9ed 100644 --- a/modules/organize/js/organize.js +++ b/modules/organize/js/organize.js @@ -103,7 +103,25 @@ function retrieve_micro_thumbs() { $(this).removeClass("ui-selected"); } }); - $(".gMicroThumbContainer").draggable({ + $(".gMicroThumbContainer").mousemove(function(event) { + if ($("#gDragHelper").length > 0 && $(this).attr("id") != "gPlaceHolder") { + if (event.pageX < this.offsetLeft + this.offsetWidth / 2) { + $(this).before($("#gPlaceHolder")); + } else { + $(this).after($("#gPlaceHolder")); + } + var container = $("#gMicroThumbPanel").get(0); + var scrollHeight = container.scrollHeight; + var scrollTop = container.scrollTop; + var height = $(container).height(); + if (event.pageY > height + scrollTop) { + container.scrollTop = this.offsetTop; + } else if (event.pageY < scrollTop) { + container.scrollTop -= height; + } + } + }); + $(".gMicroThumbContainer").draggable({ cancel: ".gMicroThumbContainer:not(.ui-selected)", handle: ".gMicroThumbContainer.ui-selected", zindex: 2000, @@ -151,12 +169,6 @@ function retrieve_micro_thumbs() { $("#gPlaceHolder").remove(); } }); - $(".gMicroThumbContainer").droppable( { - tolerance: "pointer", - over: function(event, ui) { - $(this).after($("#gPlaceHolder")); - } - }); $("#gMicroThumbPanel").droppable( { tolerance: "pointer", drop: function(event, ui) { |