MNNL#53932 Zichtbaarheid actieknoppen in meldingscherm
svn path=/Website/trunk/; revision=39623
This commit is contained in:
@@ -520,42 +520,132 @@ function do_fcltfilters()
|
||||
}
|
||||
}
|
||||
|
||||
function updateTableHeaders() {
|
||||
$("div.divrstable").each(function() {
|
||||
var elems = { hiddenHeight: function() {return (this.$originalHeaderRow.length? this.fcltHeight+this.histHeight : 0);},
|
||||
headFootRowHeight: function() {return (this.$originalHeaderRow.length? this.$floatingHeaderRow.height()+this.footHeight : this.fcltHeight+this.histHeight+this.fcltPaddingTopBottom());},
|
||||
fcltPaddingTopBottom: function() {return (parseInt(this.$fcltFrameHeader.css("paddingTop"), 10)+parseInt(this.$fcltFrameHeader.css("paddingBottom"), 10));}};
|
||||
function updateTableHeaders(event) {
|
||||
$("div.divrstable, body#showbody, body#editbody").each(function() {
|
||||
elems.$originalHeaderRow = (elems.$originalHeaderRow || $(".tableFloatingHeaderOriginal", this));
|
||||
elems.$floatingHeaderRow = (elems.$floatingHeaderRow || $(".tableFloatingHeader", this));
|
||||
elems.$floatingFooterTd = (elems.$floatingFooterTd || $("td.rsfooter", this));
|
||||
elems.$fixedFooterRow = (elems.$fixedFooterRow || $("tr.tr-footer-filler", this));
|
||||
elems.$fixedFooterTd = (elems.$fixedFooterTd || $("td.td-footer-filler", this));
|
||||
|
||||
var $originalHeaderRow = $(".tableFloatingHeaderOriginal", this);
|
||||
var $floatingHeaderRow = $(".tableFloatingHeader", this);
|
||||
elems.$fcltFrameHeader = (elems.$fcltFrameHeader || $("div.fcltframeheader"));
|
||||
elems.$fcltFiller = (elems.$fcltFiller || $("div.fcltfiller"));
|
||||
elems.$maxHistoryB = (elems.$maxHistoryB || $("#rsMaxHistoryB"));
|
||||
elems.$buttons = (elems.$buttons || $("div.hambdropdown"));
|
||||
elems.fcltHeight = (elems.$fcltFrameHeader.length ? elems.$fcltFrameHeader.outerHeight() : 0);
|
||||
elems.histHeight = (elems.$maxHistoryB.length ? elems.$maxHistoryB.outerHeight() : 0);
|
||||
elems.footHeight = (elems.$floatingFooterTd.length ? elems.$floatingFooterTd.outerHeight() : 0);
|
||||
elems.fcltPadding = (elems.fcltPadding || elems.$fcltFrameHeader.css("padding"));
|
||||
elems.histPadding = (elems.histPadding || elems.$maxHistoryB.css("padding"));
|
||||
elems.footPadding = (elems.footPadding || elems.$floatingFooterTd.css("padding"));
|
||||
elems.footColspan = (elems.footColspan || elems.$floatingFooterTd.css("colspan"));
|
||||
|
||||
// Copy row width from whole table
|
||||
// $floatingHeaderRow.css("width", $originalHeaderRow.width()); // FSN#51558 disabled (superfluous?)
|
||||
|
||||
// Copy cell widths from original header cells
|
||||
var $originalHeaderRowChildren = $originalHeaderRow.find("TH, TD");
|
||||
|
||||
$floatingHeaderRow.find("TH, TD").each(function(index) {
|
||||
var cellWidth = $originalHeaderRowChildren.eq(index).width();
|
||||
$(this).css("width", cellWidth);
|
||||
});
|
||||
|
||||
var insideFrame = $(this).offset();
|
||||
var outsideFrame = $(window.frameElement).offset();
|
||||
|
||||
var scrollTop = $(window.parent).scrollTop() + $(window).scrollTop();
|
||||
|
||||
var offset = 0;
|
||||
if (insideFrame) offset += insideFrame.top;
|
||||
if (outsideFrame && $(window.parent).scrollTop() != 0) offset += outsideFrame.top;
|
||||
|
||||
if ((scrollTop > offset) && (scrollTop < offset + $(this).height()))
|
||||
// set column widths at trigger definition or when a resize occurs
|
||||
if (!event || event.type == "resize" || event.type == "scroll")
|
||||
{
|
||||
$originalHeaderRow.css("visibility", "visible");
|
||||
$floatingHeaderRow.css("top", (Math.min(scrollTop - offset, $(this).height() - $floatingHeaderRow.height())) + "px");
|
||||
elems.windowHeight = window.parent.innerHeight;
|
||||
if (elems.$originalHeaderRow.length && elems.$originalHeaderRow.outerWidth() > 0)
|
||||
{ // set the frameheader outerWidth to the original header width
|
||||
elems.$fcltFrameHeader.outerWidth(parseInt(elems.$originalHeaderRow.outerWidth())+"px");
|
||||
}
|
||||
else
|
||||
{ // else set the frameheader outerWidth to 100%
|
||||
elems.$fcltFrameHeader.outerWidth("100%");
|
||||
}
|
||||
elems.horScrollbarHeight = 0;
|
||||
if (elems.$fcltFrameHeader.outerWidth() > window.parent.innerWidth)
|
||||
{
|
||||
elems.horScrollbarHeight = 15;
|
||||
}
|
||||
elems.$maxHistoryB.outerWidth(parseInt(elems.$originalHeaderRow.outerWidth())+"px"); // preserve the tablefooter width for use when the footer is positioned "absolute"
|
||||
elems.$floatingFooterTd.outerWidth(parseInt(elems.$originalHeaderRow.outerWidth())+"px");
|
||||
if (elems.$originalHeaderRow.length)
|
||||
{ // for tables
|
||||
// Copy cell widths from original header cells
|
||||
elems.$originalHeaderRowChildren = (elems.$originalHeaderRowChildren || elems.$originalHeaderRow.find("TH, TD"));
|
||||
elems.$floatingHeaderRowChildren = (elems.$floatingHeaderRowChildren || elems.$floatingHeaderRow.find("TH, TD"));
|
||||
elems.thisHeight = $(this).height();
|
||||
|
||||
elems.$floatingHeaderRow.outerWidth(parseInt(elems.$originalHeaderRow.outerWidth())+"px"); // set the floatingheader width to the original header width
|
||||
elems.$floatingHeaderRowChildren.each(function(index) {
|
||||
$(this).css("width", elems.$originalHeaderRowChildren.eq(index).width());
|
||||
});
|
||||
}
|
||||
else
|
||||
{ // for show and edit windows
|
||||
elems.thisHeight = $(this).closest("html").height();
|
||||
}
|
||||
}
|
||||
|
||||
if (elems.$originalHeaderRow.length)
|
||||
{ // for tables
|
||||
var insideFrame = $(this);
|
||||
}
|
||||
else
|
||||
{ // for show and edit windows
|
||||
var insideFrame = $(this).closest("html");
|
||||
}
|
||||
|
||||
var outsideFrame = $(window.frameElement);
|
||||
var scrollTop = $(window).scrollTop();
|
||||
if (window.frameElement) // if embedded
|
||||
scrollTop += $(window.parent).scrollTop();
|
||||
var offset = 0;
|
||||
if (insideFrame.length) offset += insideFrame.offset().top;
|
||||
if (outsideFrame.length) offset += outsideFrame.offset().top;
|
||||
elems.inFrame = insideFrame; // added
|
||||
elems.outFrame = outsideFrame; // for
|
||||
elems.scrollTop = scrollTop; // debug
|
||||
elems.offset = offset; // purposes
|
||||
if ($(window.frameElement) && $(window.frameElement).attr("role") == "tabpanel") // if embedded
|
||||
{ // corrections when frame is child of "tabpanel"
|
||||
scrollTop -= $(window.parent).scrollTop();
|
||||
offset -= outsideFrame.offset().top;
|
||||
}
|
||||
// calculate floating elements at top of screen
|
||||
if ((scrollTop+elems.hiddenHeight() > offset) && (scrollTop-elems.hiddenHeight() < (offset + elems.thisHeight)))
|
||||
{
|
||||
if (elems.$fcltFrameHeader.length) // frameheader present?
|
||||
elems.$fcltFrameHeader.css({position: "absolute", zIndex: "99", overflowY: "visible", padding: elems.fcltPadding,
|
||||
top: (Math.min(scrollTop - offset + elems.hiddenHeight() + elems.$fcltFiller.position().top, elems.thisHeight - elems.headFootRowHeight())) + "px"});
|
||||
if (elems.$maxHistoryB.length) // maxrecords message present?
|
||||
elems.$maxHistoryB.css({position: "absolute", zIndex: "98", padding: elems.histPadding,
|
||||
top: (Math.min(scrollTop - offset + elems.hiddenHeight() + elems.fcltHeight + elems.$fcltFiller.position().top, elems.thisHeight - elems.headFootRowHeight() + elems.fcltHeight)) + "px"});
|
||||
elems.$buttons.css({position: "absolute", zIndex: "99", right: "0"});
|
||||
elems.$originalHeaderRow.css("visibility", "visible");
|
||||
elems.$floatingHeaderRow.css("top", (Math.min(scrollTop - offset + elems.hiddenHeight(), elems.thisHeight - elems.headFootRowHeight())) + "px");
|
||||
elems.$fcltFiller.css({padding: elems.fcltPadding});
|
||||
elems.$fcltFiller.outerHeight(elems.fcltHeight+elems.histHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
$originalHeaderRow.css("visibility", "hidden");
|
||||
$floatingHeaderRow.css("top", "0px");
|
||||
elems.$fcltFrameHeader.css({position: "", zIndex: "", overflowY: "", top: "", padding: ""});
|
||||
elems.$maxHistoryB.css({position: "", zIndex: "", top: "", padding: ""});
|
||||
elems.$buttons.css({position: "", zIndex: "", right: ""});
|
||||
elems.$originalHeaderRow.css("visibility", "hidden");
|
||||
elems.$floatingHeaderRow.css("top", "0px");
|
||||
elems.$fcltFiller.css({height: 0, paddingTop: 0, paddingBottom: 0});
|
||||
}
|
||||
// calculate floating element at bottom of screen (if any)
|
||||
if (elems.$fixedFooterRow.length)
|
||||
{
|
||||
if ($(window.frameElement) && $(window.frameElement).attr("role") == "tabpanel") // if embedded
|
||||
offset += outsideFrame.offset().top;
|
||||
if ((scrollTop-offset+elems.windowHeight) <= (elems.$fixedFooterRow.offset().top))
|
||||
{
|
||||
elems.$floatingFooterTd.css({position: "absolute", zIndex: "99", overflowY: "visible", padding: elems.footPadding, collspan: elems.footColspan,
|
||||
top: (scrollTop - offset + elems.windowHeight - elems.footHeight-elems.horScrollbarHeight) + "px"});
|
||||
elems.$fixedFooterTd.css({padding: elems.footPadding});
|
||||
elems.$fixedFooterTd.outerHeight(elems.footHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
elems.$floatingFooterTd.css({position: "", zIndex: "", overflowY: "", top: "", padding: ""});
|
||||
elems.$fixedFooterTd.css({height: 0, paddingTop: 0, paddingBottom: 0});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -579,6 +669,11 @@ $(function() {
|
||||
|
||||
$originalHeaderRow.addClass("tableFloatingHeaderOriginal");
|
||||
});
|
||||
var $elem = $("div.fcltframeheader");
|
||||
var paddingHor = parseInt($elem.css("paddingLeft"),10) + parseInt($elem.css("paddingRight"),10);
|
||||
$elem.before("<div class='fcltfiller' style='height: 0; visibility: hidden; padding: "+$elem.css("padding")+"; margin: "+$elem.css("margin")+"; width: Calc(100% - "+paddingHor+"px);'></div>");
|
||||
$elem = $("td.rsfooter", this);
|
||||
$elem.parent().before("<tr class='tr-footer-filler'><td class='td-footer-filler' style='height: 0; visibility: hidden; padding: "+$elem.css("padding")+"; margin: "+$elem.css("margin")+";'></td></tr>");
|
||||
|
||||
$(window).on("scroll", updateTableHeaders);
|
||||
$(window).on("resize", updateTableHeaders);
|
||||
@@ -592,7 +687,6 @@ $(function() {
|
||||
}
|
||||
$("div.collapsed").on("click", updateTableHeaders);
|
||||
$("#autofilter").on("keyup", updateTableHeaders);
|
||||
|
||||
// Anders geheugenlek
|
||||
$(window).on("unload", function ()
|
||||
{
|
||||
@@ -604,6 +698,5 @@ $(function() {
|
||||
// in een frame?
|
||||
}
|
||||
});
|
||||
updateTableHeaders();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user