fix radio buttons in paper dialog

This commit is contained in:
Luke Pulverenti 2015-09-17 23:43:30 -04:00
parent 807cbafe55
commit 2b091ce5de
3 changed files with 39 additions and 34 deletions

View File

@ -1363,10 +1363,6 @@
atts.push('data-locationtype="' + (item.LocationType || '') + '"');
atts.push('data-index="' + index + '"');
if (options.showDetailsMenu) {
atts.push('data-detailsmenu="true"');
}
if (item.AlbumId) {
atts.push('data-albumid="' + item.AlbumId + '"');
}
@ -2679,13 +2675,21 @@
showSortMenu: function (options) {
var id = 'dlg' + new Date().getTime();
var html = '';
var dlg = document.createElement('paper-dialog');
html += '<paper-dialog id="' + id + '" entry-animation="fade-in-animation" exit-animation="fade-out-animation" with-backdrop>';
dlg.setAttribute('with-backdrop', 'with-backdrop');
dlg.setAttribute('role', 'alertdialog');
// without this safari will scroll the background instead of the dialog contents
dlg.entryAnimation = 'scale-up-animation';
dlg.exitAnimation = 'fade-out-animation';
var html = '';
// There seems to be a bug with this in safari causing it to immediately roll up to 0 height
var isScrollable = !$.browser.safari;
// Have to disable this right now because it's causing the radio buttons to not function properly in other browsers besides chrome
isScrollable = false;
html += '<h2>';
html += Globalize.translate('HeaderSortBy');
@ -2720,40 +2724,36 @@
html += '<paper-button dialog-dismiss>' + Globalize.translate('ButtonClose') + '</paper-button>';
html += '</div>';
html += '</paper-dialog>';
dlg.innerHTML = html;
document.body.appendChild(dlg);
$(document.body).append(html);
$(dlg).on('iron-overlay-closed', function () {
$(this).remove();
});
setTimeout(function () {
var dlg = document.getElementById(id);
require(['components/paperdialoghelper'], function () {
dlg.open();
PaperDialogHelper.openWithHash(dlg, 'sortmenu');
});
$(dlg).on('iron-overlay-closed', function () {
$(this).remove();
});
$('.groupSortBy', dlg).on('iron-select', function () {
options.query.SortBy = this.selected.replace('_', ',');
options.query.StartIndex = 0;
$('.groupSortBy', dlg).on('iron-select', function () {
options.query.SortBy = this.selected.replace('_', ',');
options.query.StartIndex = 0;
if (options.callback) {
options.callback();
}
});
if (options.callback) {
options.callback();
}
});
$('.groupSortOrder', dlg).on('iron-select', function () {
$('.groupSortOrder', dlg).on('iron-select', function () {
options.query.SortOrder = this.selected;
options.query.StartIndex = 0;
if (options.callback) {
options.callback();
}
});
}, 100);
options.query.SortOrder = this.selected;
options.query.StartIndex = 0;
if (options.callback) {
options.callback();
}
});
},
getRatingHtml: function (item, metascore) {

View File

@ -793,7 +793,7 @@
contentHtml += '<paper-button raised class="secondary btnPlay"><iron-icon icon="play-arrow"></iron-icon><span>' + Globalize.translate('ButtonPlay') + '</span></paper-button>';
}
contentHtml += '<paper-button data-href="' + LibraryBrowser.getHref(item, context) + '" raised class="submit btnSync" style="background-color: #673AB7;" onclick="Dashboard.navigate(this.getAttribute(\'data-href\'));"><iron-icon icon="folder-open"></iron-icon><span>' + Globalize.translate('ButtonOpen') + '</span></paper-button>';
contentHtml += '<paper-button data-href="' + LibraryBrowser.getHref(item, context) + '" raised class="submit" style="background-color: #673AB7;" onclick="Dashboard.navigate(this.getAttribute(\'data-href\'));"><iron-icon icon="folder-open"></iron-icon><span>' + Globalize.translate('ButtonOpen') + '</span></paper-button>';
if (SyncManager.isAvailable(item, user)) {
contentHtml += '<paper-button raised class="submit btnSync"><iron-icon icon="refresh"></iron-icon><span>' + Globalize.translate('ButtonSync') + '</span></paper-button>';

View File

@ -211,8 +211,13 @@ paper-button.notext {
paper-dialog {
border-radius: 4px;
z-index: 999999 !important;
font-family: inherit !important;
}
paper-dialog h2 {
font-family: inherit !important;
}
iron-overlay-backdrop {
z-index: 999998 !important;
}