mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
switch polymer to bower
This commit is contained in:
parent
b9598ffaa1
commit
8f6cbe8de2
348 changed files with 40895 additions and 310 deletions
|
@ -1,15 +1,65 @@
|
|||
(function () {
|
||||
|
||||
function onClosed() {
|
||||
$(this).remove();
|
||||
}
|
||||
function show(options) {
|
||||
|
||||
// items
|
||||
// positionTo
|
||||
// showCancel
|
||||
require(['paperbuttonstyle'], function() {
|
||||
// items
|
||||
// positionTo
|
||||
// showCancel
|
||||
// title
|
||||
var id = 'dlg' + new Date().getTime();
|
||||
var html = '';
|
||||
|
||||
html += '<paper-dialog id="' + id + '" entry-animation="scale-up-animation" exit-animation="fade-out-animation">';
|
||||
|
||||
if (options.title) {
|
||||
html += '<h2>';
|
||||
html += options.title;
|
||||
html += '</h2>';
|
||||
}
|
||||
|
||||
html += '<paper-dialog-scrollable>';
|
||||
for (var i = 0, length = options.items.length; i < length; i++) {
|
||||
|
||||
var option = options.items[i];
|
||||
|
||||
html += '<paper-button class="block blue ripple btnOption" data-id="' + option.id + '" style="margin:0;">' + option.name + '</paper-button>';
|
||||
}
|
||||
|
||||
html += '</paper-dialog-scrollable>';
|
||||
|
||||
if (options.showCancel) {
|
||||
html += '<div class="buttons">';
|
||||
html += '<paper-button dialog-dismiss>' + Globalize.translate('ButtonCancel') + '</paper-button>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</paper-dialog>';
|
||||
|
||||
$(html).appendTo(document.body);
|
||||
|
||||
setTimeout(function () {
|
||||
var dlg = document.getElementById(id);
|
||||
dlg.open();
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
$(dlg).css('z-index', '999999').on('iron-overlay-closed', onClosed);
|
||||
|
||||
$('.btnOption', dlg).on('click', function () {
|
||||
|
||||
if (options.callback) {
|
||||
options.callback(this.getAttribute('data-id'));
|
||||
}
|
||||
dlg.close();
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
window.ActionSheet = {
|
||||
window.ActionSheetElement = {
|
||||
show: show
|
||||
};
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue