-
Notifications
You must be signed in to change notification settings - Fork 14
Navigation
Cobalt offers a navigation system based on native transitions. This allows fast and furious performances for your web apps :)
It allows the web side to push any web page and to choose in which native controller the page will be shown. A default fullscreen controller is ready with Cobalt but you can create your own, and start to mix web and native components on the same view.
All navigation commands are in the cobalt.navigate scope :
- cobalt.navigate.push, to push a new page
- cobalt.navigate.pop, to pop the current page
- cobalt.navigate.popTo, to pop to a specified previous page
- cobalt.navigate.modal and cobalt.navigate.dismiss, for an alternative navigation
- cobalt.navigate.replace, to replace the current page with another
All of theses commands rely on the existance of a cobalt.conf file in the www folder, wich tells what native controller correspond to the named pages.
See the cobalt.conf
These are the messages sent to the native side for each navigation type:
{ "type":"navigation", "action":"push", data : { page :"index.html", controller: "myController" }
{ "type":"navigation", "action":"pop" }
{ "type":"navigation", "action":"modal", data : { page :"index.html", controller: "myController" }
{ "type":"navigation", "action":"dismiss" }
Cobalt is an Open-Source Hybrid Mobile Framework. Read more about it on the home page or in the documentation
- Introduction to Cobalt navigation
- The cobalt.json file
- native navigation bars
- Handling the Android back button
- Introduction to Cobalt messages
- Publish/Subscribe on the Web side
- Publish/Subscribe on Android
- Publish/Subscribe on iOS
- Web Lifecycle messages
- Pull-To-Refresh and Infinite Scroll
- Custom alerts and Toasts
- LocalStorage
- OpenExternalUrl
- PlatformInfos
- Ajax
- Removing the top bar
- Adding Cobalt to an existing project
- Customizing your hybrid views
- Handle multiple Cobalt webviews on the same screen (TODO)