enable shared components
This commit is contained in:
parent
d8482e7870
commit
3a67382505
6 changed files with 85 additions and 61 deletions
19
dashboard-ui/bower_components/emby-webcomponents/toast/toast.js
vendored
Normal file
19
dashboard-ui/bower_components/emby-webcomponents/toast/toast.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
define(['paper-toast'], function () {
|
||||
|
||||
var toastId = 0;
|
||||
|
||||
return function (options) {
|
||||
|
||||
var elem = document.createElement("paper-toast");
|
||||
elem.setAttribute('text', options.text);
|
||||
elem.id = 'toast' + (toastId++);
|
||||
|
||||
document.body.appendChild(elem);
|
||||
|
||||
// This timeout is obviously messy but it's unclear how to determine when the webcomponent is ready for use
|
||||
// element onload never fires
|
||||
setTimeout(function () {
|
||||
elem.show();
|
||||
}, 300);
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue