Logic Machine Forum
Disable autoredirect to main page. - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Disable autoredirect to main page. (/showthread.php?tid=2723)



Disable autoredirect to main page. - tpospichal - 14.07.2020

Hello my client has classic visualisation on android (shortcut on desktop) everytime when visualisation is minimised and open again he is redirected to main page of the visu. Is there any way how to fix visualization on last open room/widget.

Thank you


RE: Disable autoredirect to main page. - admin - 15.07.2020

This happens because the page is unloaded from memory and browser reloads the page from scratch.
You can use this Custom JS to remember current plan and show saved plan on every load. Plan id is store locally in browser storage. You need a recent firmware for this to work.
Code:
$(function() {
  var id = localStorage.getItem('planid');
  if (id) {
    showPlan(id);
  }

  $('body').on('showplan', function(event, id) {
    localStorage.setItem('planid', id);
  });
});



RE: Disable autoredirect to main page. - tpospichal - 15.07.2020

Thank you works perfectly.