enable shared components

This commit is contained in:
Luke Pulverenti 2016-02-16 11:15:36 -05:00
parent d8482e7870
commit 3a67382505
6 changed files with 85 additions and 61 deletions

View file

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.0.81",
"_release": "1.0.81",
"version": "1.0.82",
"_release": "1.0.82",
"_resolution": {
"type": "version",
"tag": "1.0.81",
"commit": "60dfd52a18f23047b6d6b08973ab0b77585f9a90"
"tag": "1.0.82",
"commit": "87ca65dd008946b330945c0c1adcaf3b6337c1d2"
},
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.0.0",

View file

@ -0,0 +1,14 @@
.docspinner {
margin-top: -5vh;
margin-left: -5vh;
width: 10vh;
height: 10vh;
position: fixed;
top: 50%;
left: 50%;
z-index: 9999999;
}
.loadingHide {
display: none !important;
}

View file

@ -0,0 +1,28 @@
define(['paper-spinner', 'css!./loading'], function () {
return {
show: function () {
var elem = document.querySelector('.docspinner');
if (!elem) {
elem = document.createElement("paper-spinner");
elem.classList.add('docspinner');
document.body.appendChild(elem);
}
elem.active = true;
elem.classList.remove('loadingHide');
},
hide: function () {
var elem = document.querySelector('.docspinner');
if (elem) {
elem.active = false;
elem.classList.add('loadingHide');
}
}
};
});

View 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);
};
});