@eduzz/apps-toolbar
Advanced tools
Comparing version 1.4.27 to 1.4.28
@@ -5,3 +5,3 @@ export default function EduzzToolbarSetup(params) { | ||
script.async = true; | ||
script.src = 'https://unpkg.com/@eduzz/apps-toolbar@^1.4.24/build/widget.js'; | ||
script.src = 'https://unpkg.com/@eduzz/apps-toolbar@^1.4.28/build/widget.js'; | ||
@@ -8,0 +8,0 @@ script.onload = () => { |
{ | ||
"name": "@eduzz/apps-toolbar", | ||
"version": "1.4.27", | ||
"version": "1.4.28", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -15,14 +15,11 @@ # Eduzz Apps Toolbar | ||
d.body.append(s); | ||
})(document, 'https://unpkg.com/@eduzz/apps-toolbar@^1.4.1/build/widget.js', function () { | ||
})(document, 'https://unpkg.com/@eduzz/apps-toolbar@^1.4.28/build/widget.js', function () { | ||
var toolbar = window.EduzzAppsToolbar({ | ||
application: 'nutror', | ||
//You can set the user in the initial config | ||
accessKey: '123', | ||
eduzzUserId: 1, | ||
eduzzUserEmail: 'daniel.prado@eduzz.com' | ||
show: true //default false | ||
}); | ||
// Or later | ||
toolbar.setUser('accessKey',1, 'daniel.prado@eduzz.com'); | ||
toolbar.setUser(null); // hide | ||
toolbar.show(); | ||
toolbar.hide(); | ||
}); | ||
@@ -38,10 +35,9 @@ ``` | ||
const promiseToolbar = EduzzAppsToolbar({ | ||
application: 'nutror' | ||
application: 'nutror', | ||
show: true //default false | ||
}); | ||
export async function setUser(user: IUser) { | ||
export async function show(user: IUser) { | ||
const toolbar = await promiseToolbar; | ||
if (!toolbar) return; | ||
toolbar.setUser(user.hash, user.clicodeduzz, user.email); | ||
toolbar.show(); | ||
} | ||
@@ -51,6 +47,4 @@ | ||
const toolbar = await promiseToolbar; | ||
if (!toolbar) return; | ||
toolbar.setUser(null); | ||
toolbar.hide(); | ||
} | ||
``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1009244
47