Adding overflow markers for preview frame scroller

This commit is contained in:
Vince
2013-06-13 22:55:19 +02:00
parent 2a32a7f9fe
commit 8b265bdb9b
3 changed files with 81 additions and 10 deletions

View File

@@ -11,9 +11,14 @@
$.subscribe(Events.TOOL_RELEASED, this.flagForRedraw_.bind(this));
$.subscribe(Events.FRAMESHEET_RESET, this.flagForRedraw_.bind(this));
$.subscribe(Events.FRAMESHEET_RESET, this.refreshDPI_.bind(this));
$('#preview-list-scroller').scroll(this.onScroll_.bind(this))
};
ns.PreviewFilmController.prototype.init = function() {};
ns.PreviewFilmController.prototype.init = function() {
};
ns.PreviewFilmController.prototype.addFrame = function () {
this.framesheet.addEmptyFrame();
@@ -36,6 +41,28 @@
}
};
ns.PreviewFilmController.prototype.onScroll_ = function (evt) {
var scroller = $('#preview-list-scroller');
var scrollerHeight = scroller.height();
var scrollTop = scroller.scrollTop();
var scrollerContentHeight = $('#preview-list').height();
var treshold = 30;
var overflowTop = false,
overflowBottom = false;
if (scrollerHeight < scrollerContentHeight) {
if (scrollTop > treshold) {
overflowTop = true;
}
var scrollBottom = (scrollerContentHeight - scrollTop) - scrollerHeight;
if (scrollBottom > treshold) {
overflowBottom = true;
}
var wrapper = $('#preview-list-wrapper');
wrapper.toggleClass('top-overflow-visible', overflowTop);
wrapper.toggleClass('bottom-overflow-visible', overflowBottom);
}
};
ns.PreviewFilmController.prototype.createPreviews_ = function () {
this.container.html("");
@@ -68,11 +95,11 @@
*/
ns.PreviewFilmController.prototype.initDragndropBehavior_ = function () {
$( "#preview-list" ).sortable({
$("#preview-list").sortable({
placeholder: "preview-tile-drop-proxy",
update: $.proxy(this.onUpdate_, this)
});
$( "#preview-list" ).disableSelection();
$("#preview-list").disableSelection();
};
/**