Logic Machine Forum
Usermode view - 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: Usermode view (/showthread.php?tid=5624)

Pages: 1 2


Usermode view - jmir - 18.09.2024

Hi,
Is it possible to apply usermode view "Center horizontally, auto-size width" to specific plans (not to all project)?
Thanks.


RE: Usermode view - admin - 19.09.2024

Not possible, this setting is global for all plans.


RE: Usermode view - jmir - 19.09.2024

(19.09.2024, 11:00)admin Wrote: Not possible, this setting is global for all plans.

And is it not possible to override using css or js in any way?


RE: Usermode view - admin - 19.09.2024

Explain in more detail what do you want to achieve.


RE: Usermode view - jmir - 19.09.2024

(19.09.2024, 11:05)admin Wrote: Explain in more detail what do you want to achieve.

I want to use some plans as mobile visualitzation (like a menu view) and need to scroll up/down and I want to use other plans as desktop visualitzation (and need to fit them to the screen)


RE: Usermode view - jmir - 03.03.2025

(19.09.2024, 11:05)admin Wrote: Explain in more detail what do you want to achieve.

Is there any way to do it?


RE: Usermode view - admin - 03.03.2025

Only one view mode is supported for all users.


RE: Usermode view - jmir - 03.03.2025

(03.03.2025, 07:38)admin Wrote: Only one view mode is supported for all users.

And is it not possible to override this mode for specific plans? (not users)


RE: Usermode view - jmir - 05.03.2025

(03.03.2025, 07:40)jmir Wrote:
(03.03.2025, 07:38)admin Wrote: Only one view mode is supported for all users.

And is it not possible to override this mode for specific plans? (not users)

No way to override for specific plans?


RE: Usermode view - admin - 05.03.2025

Try this CSS, adjust plan IDs as needed. Some features like backgrounds won't work correctly.
Code:
.layers {
  overflow-y: auto;
}

#plan-2,
#plan-3 {
  transform: none !important;
  margin: 0 auto !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;  
}



RE: Usermode view - didac - 05.03.2025

Hello.
I have tried the code and it doesn't work. Is it possible to apply the Usermode View "Center plans, enable auto-sizing" on a specific plan using css or js?
Thanks


RE: Usermode view - admin - 05.03.2025

No, it's not possible.

Did you adjust the rules with relevant plan IDs?


RE: Usermode view - didac - 05.03.2025

(05.03.2025, 10:15)admin Wrote: No, it's not possible.

Did you adjust the rules with relevant plan IDs?

Yes, I have set the rule according to the id plan. It doesn't work


RE: Usermode view - admin - 05.03.2025

You need to set view mode to "Center plans, enable auto-sizing". Plans added to the CSS rule will be shown as is using their original size without scaling. If plan height is larger than the screen height then a scrollbar will appear.


RE: Usermode view - admin - 05.03.2025

Try this:

CSS:
Code:
.layers {
  overflow-y: auto;
}
.layer-centered-h {
  margin-top: 0 !important;
}

JS (change scrollIds array as needed):
Code:
var origDoShowPlan = window.doShowPlan
if (origDoShowPlan) {
  var scrollIds = [2, 3, 4]
 
  $(function() {
    scrollIds.forEach(function(id) {
      $('#plan-' + id).addClass('layer-centered-h')
    })
  })

  doShowPlan = function(plan) {
    visAutoWidth = scrollIds.indexOf(currentPlanId) >= 0
    origDoShowPlan(plan)
  }
}



RE: Usermode view - didac - 05.03.2025

Changing the set view mode and using the above code works, but only with 1920x1080 screens. With smaller screens, I can't see the full width. Also, with this modification, I can't scroll if I open a widget. Now I'll try this new example.

Thanks


RE: Usermode view - jmir - 06.03.2025

(05.03.2025, 13:02)admin Wrote: Try this:

CSS:
Code:
.layers {
  overflow-y: auto;
}
.layer-centered-h {
  margin-top: 0 !important;
}

JS (change scrollIds array as needed):
Code:
var origDoShowPlan = window.doShowPlan
if (origDoShowPlan) {
  var scrollIds = [2, 3, 4]
 
  $(function() {
    scrollIds.forEach(function(id) {
      $('#plan-' + id).addClass('layer-centered-h')
    })
  })

  doShowPlan = function(plan) {
    visAutoWidth = scrollIds.indexOf(currentPlanId) >= 0
    origDoShowPlan(plan)
  }
}

Hi, I've done some tests and it works if don't open any widget... When I do it (inside a scrollable plan) then scrollbar appears on non-scrollable plans...


RE: Usermode view - admin - 06.03.2025

Remove from CSS:
Code:
.layers {
  overflow-y: auto;
}

Modify JS:
Code:
doShowPlan = function(plan) {
  visAutoWidth = scrolIds.indexOf(currentPlanId) >= 0
  $('.layers').css('overflow-y', visAutoWidth ? 'auto' : 'hidden')
  origDoShowPlan(plan)
}



RE: Usermode view - jmir - 06.03.2025

(06.03.2025, 14:54)admin Wrote: Remove from CSS:
Code:
.layers {
  overflow-y: auto;
}

Modify JS:
Code:
doShowPlan = function(plan) {
  visAutoWidth = scrolIds.indexOf(currentPlanId) >= 0
  $('.layers').css('overflow-y', visAutoWidth ? 'auto' : 'hidden')
  origDoShowPlan(plan)
}

Now I does not switch between plans....


RE: Usermode view - admin - 06.03.2025

You need to replace only the doShowPlan function not the whole JS code. Complete JS should look like this:
Code:
var origDoShowPlan = window.doShowPlan
if (origDoShowPlan) {
  var scrolIds = [2, 3, 4]
  
  $(function() {
    scrolIds.forEach(function(id) {
      $('#plan-' + id).addClass('layer-centered-h')
    })
  })

  doShowPlan = function(plan) {
    visAutoWidth = scrolIds.indexOf(currentPlanId) >= 0
    $('.layers').css('overflow-y', visAutoWidth ? 'auto' : 'hidden');
    origDoShowPlan(plan)
  }
}