Select to view content in your preferred language

Modifying panel height results in incorrect position on mobile devices

704
6
Jump to solution
08-29-2019 07:39 AM
MaximeDemers
Frequent Contributor

Hi,

I want to reduce the height of a widget panel. I did so using a css like

#My_Widget_panel {

  height: 290px !important;

}

However, when I open the app on a mobile, the panel is not positioned a the the bottom of the screen.

Is there a way to position the panel correctly on mobile device?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Maxime,

  OK, looking at the Panel.js code yes the height position is ignored. So you would have to change the code in the Panel.js file to fix that.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Maxime,

  Don't adjust the panels height using css. Instead do the height adjustment in code.

0 Kudos
MaximeDemers
Frequent Contributor

I have found another of your answers that use the following code in the startup:

      var panel = this.getPanel();
      var pos = panel.position;
      pos.height = 290;
      panel.setPosition(pos);
      panel.panelManager.normalizePanel(panel);

But there is no effect in my app. I also tryed using the resize method

       var panel = this.getPanel();

       panel.resize(290, 290);

But no effect neither. Any suggestion? Thank you

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Maxime,

  Does this.getPanel() return an object or is it null?

0 Kudos
MaximeDemers
Frequent Contributor

Yes, it returns the widget panel object.

I don't know if it's related to my problem, but the widget is not a widgetOnScreen, it's a widget with a button embedded in the header, so in the config.json, it is in the widgetPool property.

0 Kudos
MaximeDemers
Frequent Contributor

It's a "themes/FoldableTheme/panels/FoldablePanel/Panel"

It seems the only position that affect the height is the bottom position. Height and width have not effect.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Maxime,

  OK, looking at the Panel.js code yes the height position is ignored. So you would have to change the code in the Panel.js file to fix that.

0 Kudos