How to use Drawers and Tabs after initialView in SuperSonic

148 Views Asked by At

I'm using Appgyver & Supersonic. This app is Login Only, no content before login

My initial view is a login page. Once authorized I replace view stack with the Dashboard.

var view = new supersonic.ui.View('dashboard#index');
        view.start("dashboard").then(function (startedView) {
            supersonic.ui.layers.replace(startedView);
        });

Now the dashboard will pop up. But dealing with the Tabs and Drawers API results in errors because those webviews are no longer there.

My ideal set up is this:

  1. A login page and nothing more
  2. Once logged in, Tabs and Drawers are enabled

I cannot figure this set up out, I can't find documentation on these subjects. How can I init Drawers and Tabs after replacing the Initial View.

structure.coffee as requested:

  tabs: [
    {
      title: "Login"
      id: "login"
      location: "default#login" 
    }
    {
      title: "Profile"
      id: "settings"
      location: "dashboard#profile"
    }
    {
      title: "Settings"
      id: "internet"
      location: "http://google.com" # URLs are supported!
    }
  ]

  drawers:
     left:
       id: "leftDrawer"
       location: "dashboard#drawer"
       showOnAppLoad: false
     options:
       animation: "swingingDoor"

  initialView:
    id: "initialView"
    location: "default#login"
1

There are 1 best solutions below

0
Theodore Enderby On

Eureka!

What you want to do for this setup is have initialView be the login page and instead of replacing the layer stack, just dismiss the initialView. This is clearly in the documentation I was just doing something wrong.

Doing it this way does create the tabs and the drawers