Screen.reload() #535

Closed
tneil opened this Issue Dec 18, 2012 · 4 comments

Comments

Projects
None yet
3 participants
Member

tneil commented Dec 18, 2012

Add a function to the bb object to reload the current topmost screen.

bb.reloadScreen();

This function will clear the current display and then reload all the contents of that screen just as though it was called via pushScreen(). However, the animations for reloading this screen will not be triggered.

Currently pushScreen is defined as function (url, id, params)

When reloadScreen() is called, will it include the params that was passed to pushScreen(), or at least provide the ability to override the said params

e.g.

reloadScreen( [params] ) // where [params] is optional. If not passed, use the params previously passed to pushScreen

Member

tneil commented Dec 18, 2012

It would pass the exact same parameters that were passed in from the initial pushScreen() call

This is how we've done it.

            var numItems = bb.screens.length;

    // get the item that is displayed on screen
    var display = bb.screens[numItems-1];

    // push the displayed screen again
    bb.pushScreen(display.url, display.id, display.params);

    // remove the previous screen element from the DOM. This sticks around on the DOM for some reason
    bb.removePreviousScreenFromDom();

    // Remove the last but previus screen from the display stack
    bb.screens.splice(numItems-1,1);
Member

tneil commented Jan 18, 2013

Closing this issue in favor of the consolidated feature for screen management issue #616. There are lots of different threads around screen management. Looking to consolidate all the feedback into one main requirement. I'll mark this as a duplicate.

@tneil tneil closed this Jan 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment