summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-13 10:56:50 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-08-13 10:56:50 -0700
commit5a84df9ac501b57cb5b472dc57590eef5e165dc3 (patch)
tree50ee9ad385a41750507fc1208fac696fbebc3b20
parent3823f65dfb4114caf9bd9cfbf730638927f6c970 (diff)
Vertical scrolling of the thumb grid seems to work better now. Wasn't able to get the draggable autoscrolling working, so this is a poor replacemment.
-rw-r--r--modules/organize/js/organize.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index c9408673..aadc713a 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -3,7 +3,7 @@
micro_thumb_draggable: {
distance: 10,
cursorAt: { left: -10, top: -10},
- appendTo: "#gOrganizeContentPane",
+ //appendTo: "#gOrganizeContentPane",
helper: function(event, ui) {
var selected = $("li.ui-state-selected img"),
set = $('<div class="temp"></div>').css({zIndex: 2000, width: 80, height: Math.ceil(selected.length / 5) * 16 }),
@@ -28,21 +28,19 @@
return set;
},
start: function(event, ui) {
- $("#gMicroThumbPanel").prepend("<div id=\"gPlaceHolder\"></div>");
-
$("#gMicroThumbPanel li.ui-state-selected").hide();
},
drag: function(event, ui) {
- var container = $("#gMicroThumbPanel").get(0);
- var scrollTop = container.scrollTop;
- var height = $(container).height();
- if (event.pageY > height + scrollTop) {
- container.scrollTop += height;
- } else if (event.pageY < scrollTop) {
- container.scrollTop -= height;
+ var top = $("#gMicroThumbPanel").offset().top;
+ var height = $("#gMicroThumbPanel").height();
+ if (ui.offset.top > height + top - 20) {
+ $("#gMicroThumbPanel").get(0).scrollTop += 100;
+ } else if (ui.offset.top < top + 20) {
+ $("#gMicroThumbPanel").get(0).scrollTop = Math.max(0, $("#gMicroThumbPanel").get(0).scrollTop - 100);
}
},
stop: function(event, ui) {
+ // @todo delete this method when drop is implemented
$("li.ui-state-selected").show();
}
},
@@ -63,6 +61,7 @@
// tree: null | new tree,
// content: new thumbgrid
// }
+ // do forget to reset all the stuff in init when updating the content
}
},
@@ -92,7 +91,7 @@
$(".gBranchText").click($.organize.show_album);
$("#gMicroThumbPanel").selectable({filter: "li"});
- $("#gMicroThumbPanel img").draggable($.organize.micro_thumb_draggable);
+ $("#gMicroThumbPanel li").draggable($.organize.micro_thumb_draggable);
$(".gOrganizeBranch").droppable($.organize.droppable);
$("#gMicroThumbPanel").droppable($.organize.droppable);
},