How to set NearMe Widget to open as expanded on a smart phone

736
7
Jump to solution
09-11-2018 05:56 AM
Sung-JunKim1
New Contributor II

I am using a developer edition of web appbuilder to build a information viewer (government service) only using a NearMe Widget.  This application will be mainly used by small screen smart phones.  I set this widget to open when it starts.  When this widget or any other widgets  open on a smart phone, a max button icon appears so that the widget window can be fully expanded for easier use.  When it opens first, the widget only opens on a half of the screen on a phone.  See the attached. Left image is when it opens.  The right image is right after max button is clicked.  I would like to set this nearMe widget to open as a full screen on a phone when it starts.  We can't assume the public will know to click on a max button when they use this application.

 Is there anyway that I can set the max-button to true when the nearMe widget starts?  I only need to control this NearMe widget for a specific web application.

 

Thanks,

SJ

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

SJ,

  So for the LaunchPad theme you have to make this change to the Panel.js in the 

[install dir]\server\apps\[app#]\themes\LaunchpadTheme\panels\LaunchpadPanel\Panel.js

    startup: function(){
      this.inherited(arguments);

      this.panelManager.normalizePanel(this);
      if(this.label === 'Near Me'){
        this.maxNode.click();
      }
    },‍‍‍‍‍‍‍‍

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

SJ,

  In your apps jimu.js/OnScreenWidgetPanel.js make this change to the onOpen function:

      onOpen: function() {
        if (this._resizeOnOpen) {
          this.resize();
          this._resizeOnOpen = false;
        }

        if (window.appInfo.isRunInMobile) {
          if(this.label === 'Near Me'){
            this.maxNode.click();
          }
          this._setMobilePosition();
        }

        this.inherited(arguments);
      },‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
Sung-JunKim1
New Contributor II

Good afternoon Robert,

I added the code, but the widget still opens as a half screen.  I have to click on the max button to make it expanded.

Would you please try it on your phone?

https://gis.columbiasc.gov/coc

Thanks,

SJ

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

SJ,

   You did not mention you were using the Launchpad theme. I will have to look to see what changes have to be made for that theme.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

SJ,

  So for the LaunchPad theme you have to make this change to the Panel.js in the 

[install dir]\server\apps\[app#]\themes\LaunchpadTheme\panels\LaunchpadPanel\Panel.js

    startup: function(){
      this.inherited(arguments);

      this.panelManager.normalizePanel(this);
      if(this.label === 'Near Me'){
        this.maxNode.click();
      }
    },‍‍‍‍‍‍‍‍
Sung-JunKim1
New Contributor II

Robert's suggestion on adding two lines of code on panel.js was perfectly working for Launchpad theme.

Thanks,

SJ

0 Kudos
Sung-JunKim1
New Contributor II

Robert,

It works beautifully.  

Thank you so much.

SJ

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos