Update Forms page sizes (fixes #35)
This commit is contained in:
parent
23d5f1df77
commit
6e05c2677b
|
@ -15,5 +15,19 @@ namespace Ooui.Forms
|
||||||
{
|
{
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool TriggerEventFromMessage (Message message)
|
||||||
|
{
|
||||||
|
if (message.TargetId == "window" && message.Key == "resize" && message.Value is Newtonsoft.Json.Linq.JObject j) {
|
||||||
|
var width = (double)j["width"];
|
||||||
|
var height = (double)j["height"];
|
||||||
|
Platform.Element.Style.Width = width;
|
||||||
|
Platform.Element.Style.Height = height;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return base.TriggerEventFromMessage (message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,8 +100,8 @@ function ooui (rootElementPath) {
|
||||||
function resizeHandler() {
|
function resizeHandler() {
|
||||||
const em = {
|
const em = {
|
||||||
m: "event",
|
m: "event",
|
||||||
id: 42,
|
id: "window",
|
||||||
k: "window.resize",
|
k: "resize",
|
||||||
v: getSize (),
|
v: getSize (),
|
||||||
};
|
};
|
||||||
const ems = JSON.stringify (em);
|
const ems = JSON.stringify (em);
|
||||||
|
|
Loading…
Reference in New Issue