in src/main/jbake/assets/js/tree.jquery.js [2074:2120]
ScrollHandler.prototype._initScrollParent = function() {
var $scroll_parent, getParentWithOverflow, setDocumentAsScrollParent;
getParentWithOverflow = (function(_this) {
return function() {
var css_values, el, hasOverFlow, i, len, ref;
css_values = ['overflow', 'overflow-y'];
hasOverFlow = function(el) {
var css_value, i, len, ref;
for (i = 0, len = css_values.length; i < len; i++) {
css_value = css_values[i];
if ((ref = $.css(el, css_value)) === 'auto' || ref === 'scroll') {
return true;
}
}
return false;
};
if (hasOverFlow(_this.tree_widget.$el[0])) {
return _this.tree_widget.$el;
}
ref = _this.tree_widget.$el.parents();
for (i = 0, len = ref.length; i < len; i++) {
el = ref[i];
if (hasOverFlow(el)) {
return $(el);
}
}
return null;
};
})(this);
setDocumentAsScrollParent = (function(_this) {
return function() {
_this.scroll_parent_top = 0;
return _this.$scroll_parent = null;
};
})(this);
if (this.tree_widget.$el.css('position') === 'fixed') {
setDocumentAsScrollParent();
}
$scroll_parent = getParentWithOverflow();
if ($scroll_parent && $scroll_parent.length && $scroll_parent[0].tagName !== 'HTML') {
this.$scroll_parent = $scroll_parent;
this.scroll_parent_top = this.$scroll_parent.offset().top;
} else {
setDocumentAsScrollParent();
}
return this.is_initialized = true;
};