3.2.8 • Published 1 year ago
@laerdal/navigation
Licence
MIT
Version
3.2.8
Deps
6
Size
5.4 MB
Vulns
23
Weekly
0
MyLaerdal global navigation
This package builds to a single .js file that can be used to add global navigation / service switcher to all Laerdal web applications.
Questions? Go find Thomas Kalve or Erik J. Sandal.
How to build and test locally
- Clone the repository:
git clone git@bitbucket.org:laerdal/portal.git - Switch to the navigation package:
cd packages/navigation - Install dependencies:
yarn - Build the navigation package:
yarn build - Serve the current directory on localhost:
serve . - Access index.html on
http://localhost:5000
If you are missing serve, run yarn global add serve. If you are missing yarn, visit the yarn install page.
Embed into an application
- Serve
dist/globalNav.json an appropriate location on the interwebz (Its temporarily hosted on: https://myportal-test.azurewebsites.net/globalNav.js) - Add the script to your webpage:
<script src="https://example.com/globalNav/globalNav.js" />
- Use the methods on
window.globalNavto show, hide or toggle the switcher:
<button onClick="window.globalNav.show()">Show</button>
<button onClick="window.globalNav.hide()">Hide</button>
<button onClick="window.globalNav.toggle()">Toggle</button>
- Nice!
Integration with SAP CDC
The globalNav script will look for the Gigya Web SDK and bind to the gigya events, ie. onLogin and onLogout.