Store sidebar visibility status.
This commit is contained in:
parent
e61aabd77c
commit
b0a5388c12
@ -17,7 +17,7 @@ OV.Sidebar = class
|
||||
Show (show)
|
||||
{
|
||||
this.visible = show;
|
||||
if (show) {
|
||||
if (this.visible) {
|
||||
this.parentDiv.show ();
|
||||
} else {
|
||||
this.parentDiv.hide ();
|
||||
|
||||
@ -29,6 +29,7 @@ OV.Website = class
|
||||
this.InitToolbar ();
|
||||
this.InitDragAndDrop ();
|
||||
this.InitModelLoader ();
|
||||
this.InitSidebar ();
|
||||
this.InitNavigator ();
|
||||
this.InitCookieConsent ();
|
||||
|
||||
@ -80,6 +81,13 @@ OV.Website = class
|
||||
}
|
||||
}
|
||||
|
||||
ShowSidebar (show)
|
||||
{
|
||||
this.sidebar.Show (show);
|
||||
this.cookieHandler.SetBoolVal ('ov_show_sidebar', show);
|
||||
this.Resize ();
|
||||
}
|
||||
|
||||
ClearModel ()
|
||||
{
|
||||
if (this.dialog !== null) {
|
||||
@ -323,9 +331,7 @@ OV.Website = class
|
||||
});
|
||||
}
|
||||
AddRightButton (this.toolbar, 'details', 'Details Panel', true, function () {
|
||||
let isVisible = obj.sidebar.IsVisible ();
|
||||
obj.sidebar.Show (!isVisible);
|
||||
obj.Resize ();
|
||||
obj.ShowSidebar (!obj.sidebar.IsVisible ());
|
||||
});
|
||||
|
||||
this.parameters.fileInput.on ('change', function (ev) {
|
||||
@ -376,6 +382,12 @@ OV.Website = class
|
||||
});
|
||||
}
|
||||
|
||||
InitSidebar ()
|
||||
{
|
||||
let show = this.cookieHandler.GetBoolVal ('ov_show_sidebar', true);
|
||||
this.ShowSidebar (show);
|
||||
}
|
||||
|
||||
InitNavigator ()
|
||||
{
|
||||
function GetMeshUserData (viewer, meshIndex)
|
||||
@ -465,15 +477,14 @@ OV.Website = class
|
||||
|
||||
InitCookieConsent ()
|
||||
{
|
||||
let cookieConsentKey = 'ov_cookie_consent';
|
||||
let accepted = this.cookieHandler.GetBoolVal (cookieConsentKey, false);
|
||||
let accepted = this.cookieHandler.GetBoolVal ('ov_cookie_consent', false);
|
||||
if (accepted) {
|
||||
return;
|
||||
}
|
||||
|
||||
let obj = this;
|
||||
OV.ShowCookieDialog (function () {
|
||||
obj.cookieHandler.SetBoolVal (cookieConsentKey, true);
|
||||
obj.cookieHandler.SetBoolVal ('ov_cookie_consent', true);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user