minor fixes and improvements
This commit is contained in:
parent
413cf121c3
commit
83c02a2773
@ -832,3 +832,60 @@ System.AddEventListener(window, "load", function()
|
||||
{
|
||||
System.ClassList.Remove(document.body, "uwt-javascript-disabled");
|
||||
});
|
||||
|
||||
System.EnsureElementVisible = function(element, relativeToElement)
|
||||
{
|
||||
var buttonRect = null;
|
||||
if (relativeToElement !== null)
|
||||
{
|
||||
buttonRect = relativeToElement.getBoundingClientRect();
|
||||
|
||||
console.log ("button rect: ");
|
||||
console.log(buttonRect);
|
||||
|
||||
var previewRect = element.getBoundingClientRect();
|
||||
console.log ("preview rect: ");
|
||||
console.log(previewRect);
|
||||
|
||||
element.style.top = buttonRect.bottom + "px";
|
||||
element.style.left = buttonRect.right + "px";
|
||||
|
||||
var offsetBottom = element.offsetTop + previewRect.height;
|
||||
console.log ("popup bottom: " + offsetBottom);
|
||||
console.log ("document height: " + document.body.clientHeight);
|
||||
|
||||
element.style.left = buttonRect.right + "px";
|
||||
if (offsetBottom > document.body.clientHeight)
|
||||
{
|
||||
element.style.top = "";
|
||||
element.style.bottom = (document.body.clientHeight - buttonRect.top) + "px";
|
||||
}
|
||||
else
|
||||
{
|
||||
element.style.top = buttonRect.bottom + "px";
|
||||
element.style.bottom = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var previewRect = element.getBoundingClientRect();
|
||||
console.log ("preview rect: ");
|
||||
console.log(previewRect);
|
||||
|
||||
var offsetTop = element.offsetTop;
|
||||
var offsetBottom = element.offsetTop + previewRect.height;
|
||||
console.log ("popup bottom: " + offsetBottom);
|
||||
console.log ("document height: " + document.body.clientHeight);
|
||||
|
||||
if (offsetBottom > document.body.clientHeight)
|
||||
{
|
||||
var newBottom = document.body.clientHeight - offsetTop; // (offsetBottom - document.body.clientHeight);
|
||||
console.log("new bottom: " + newBottom + "px")
|
||||
element.style.top = "";
|
||||
element.style.bottom = newBottom + "px";
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -24,32 +24,7 @@ function AdditionalDetailWidget(parent)
|
||||
return;
|
||||
}
|
||||
|
||||
var buttonRect = this.ButtonLink.getBoundingClientRect();
|
||||
console.log ("button rect: ");
|
||||
console.log(buttonRect);
|
||||
|
||||
var previewRect = this.PreviewElement.getBoundingClientRect();
|
||||
console.log ("preview rect: ");
|
||||
console.log(previewRect);
|
||||
|
||||
this.PreviewElement.style.top = buttonRect.bottom + "px";
|
||||
this.PreviewElement.style.left = buttonRect.right + "px";
|
||||
|
||||
var offsetBottom = this.PreviewElement.offsetTop + previewRect.height;
|
||||
console.log ("popup bottom: " + offsetBottom);
|
||||
console.log ("document height: " + document.body.clientHeight);
|
||||
|
||||
this.PreviewElement.style.left = buttonRect.right + "px";
|
||||
if (offsetBottom > document.body.clientHeight)
|
||||
{
|
||||
this.PreviewElement.style.top = "";
|
||||
this.PreviewElement.style.bottom = (document.body.clientHeight - buttonRect.top) + "px";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PreviewElement.style.top = buttonRect.bottom + "px";
|
||||
this.PreviewElement.style.bottom = "";
|
||||
}
|
||||
System.EnsureElementVisible(this.PreviewElement, this.ButtonLink);
|
||||
};
|
||||
|
||||
this.Show = function ()
|
||||
@ -121,7 +96,7 @@ function AdditionalDetailWidget(parent)
|
||||
this.TextLink.addEventListener("focus", function(e)
|
||||
{
|
||||
if (e.relatedTarget !== null)
|
||||
{Show
|
||||
{
|
||||
var pos = this.compareDocumentPosition(e.relatedTarget);
|
||||
if (pos == Node.DOCUMENT_POSITION_FOLLOWING && e.relatedTarget !== this.NativeObject.ButtonLink)
|
||||
{
|
||||
|
||||
@ -70,6 +70,7 @@ function ContextMenu()
|
||||
{
|
||||
if (!System.ClassList.Contains(this, "uwt-visible"))
|
||||
{
|
||||
System.ClassList.Remove(document.body, "uwt-prevent-scrolling");
|
||||
this.remove();
|
||||
}
|
||||
});
|
||||
@ -154,11 +155,13 @@ function ContextMenu()
|
||||
if (parent == null) parent = document.body;
|
||||
parent.appendChild(elem);
|
||||
this.ParentElement = elem;
|
||||
System.ClassList.Add(document.body, "uwt-prevent-scrolling");
|
||||
}
|
||||
this.ParentElement.className = "uwt-menu uwt-popup";
|
||||
|
||||
this.ParentElement.offsetWidth = this.ParentElement.offsetWidth; // thanks https://stackoverflow.com/a/24195559
|
||||
System.ClassList.Add(this.ParentElement, "uwt-visible");
|
||||
System.EnsureElementVisible(this.ParentElement, null);
|
||||
};
|
||||
this.Hide = function()
|
||||
{
|
||||
|
||||
@ -1016,6 +1016,11 @@
|
||||
*/
|
||||
public static function Launch()
|
||||
{
|
||||
if (!session_start())
|
||||
{
|
||||
echo ("session_start didn't work!");
|
||||
}
|
||||
|
||||
System::Initialize();
|
||||
|
||||
if (System::$EnableTenantedHosting)
|
||||
@ -1123,7 +1128,7 @@
|
||||
|
||||
if (!$success)
|
||||
{
|
||||
$retval = call_user_func(System::$ErrorEventHandler, new ErrorEventArgs("The specified resource is not available on this server. (" . (System::$EnableTenantedHosting ? ("Tenanted - " . System::GetTenantName()) : "Non-Tenanted") . ")"));
|
||||
$retval = call_user_func(System::$ErrorEventHandler, new ErrorEventArgs("The specified resource is not available on this server. (" . (System::$EnableTenantedHosting ? ("Tenanted - " . System::GetTenantName()) : "Non-Tenanted") . ")<br />Path: " . $_GET["virtualpath"]));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -1321,9 +1326,4 @@
|
||||
}
|
||||
|
||||
\date_default_timezone_set(System::GetConfigurationValue("System.DefaultTimezone", date_default_timezone_get()));
|
||||
|
||||
if (!session_start())
|
||||
{
|
||||
echo ("session_start didn't work!");
|
||||
}
|
||||
?>
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ("<a class=\"apb-text apb-empty\" tabindex=\"-1\">" . $this->Text . "</a>");
|
||||
echo ("<a class=\"apb-text apb-empty\" tabindex=\"-1\">" . ($this->Text == "" ? " " : $this->Text) . "</a>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user