Merge pull request #1322 from MediaBrowser/master

rework dialog headers
This commit is contained in:
Luke 2015-12-15 15:14:45 -05:00
commit 2a46b87ca9
5 changed files with 33 additions and 44 deletions

View File

@ -119,12 +119,9 @@
var html = ''; var html = '';
html += '<form class="newCollectionForm" style="max-width:100%;">'; html += '<form class="newCollectionForm" style="margin:auto;">';
html += '<br />';
html += '<div class="fldSelectCollection">'; html += '<div class="fldSelectCollection">';
html += '<br />';
html += '<label for="selectCollectionToAddTo">' + Globalize.translate('LabelSelectCollection') + '</label>'; html += '<label for="selectCollectionToAddTo">' + Globalize.translate('LabelSelectCollection') + '</label>';
html += '<select id="selectCollectionToAddTo" data-mini="true"></select>'; html += '<select id="selectCollectionToAddTo" data-mini="true"></select>';
html += '</div>'; html += '</div>';
@ -197,29 +194,27 @@
}); });
var html = ''; var html = '';
html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" mini class="btnCloseDialog"></paper-fab>';
var title = items.length ? Globalize.translate('HeaderAddToCollection') : Globalize.translate('HeaderNewCollection'); var title = items.length ? Globalize.translate('HeaderAddToCollection') : Globalize.translate('HeaderNewCollection');
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + title + '</div>'; html += '<div class="dialogHeader">';
html += '</h2>'; html += '<paper-icon-button icon="close" class="btnCancel"></paper-icon-button>';
html += '<div class="dialogHeaderTitle">';
html += '<div class="editorContent" style="max-width:800px;margin:auto;">'; html += title;
html += getEditorHtml();
html += '</div>'; html += '</div>';
html += '</div>';
html += getEditorHtml();
dlg.innerHTML = html; dlg.innerHTML = html;
document.body.appendChild(dlg); document.body.appendChild(dlg);
var editorContent = dlg.querySelector('.editorContent'); initEditor(dlg, items);
initEditor(editorContent, items);
$(dlg).on('iron-overlay-closed', onDialogClosed); $(dlg).on('iron-overlay-closed', onDialogClosed);
paperDialogHelper.open(dlg); paperDialogHelper.open(dlg);
$('.btnCloseDialog', dlg).on('click', function () { $('.btnCancel', dlg).on('click', function () {
paperDialogHelper.close(dlg); paperDialogHelper.close(dlg);
}); });

View File

@ -7,7 +7,7 @@
function onIdentificationFormSubmitted() { function onIdentificationFormSubmitted() {
var page = $(this).parents('.editorContent'); var page = $(this).parents('paper-dialog');
searchForIdentificationResults(page); searchForIdentificationResults(page);
return false; return false;
@ -193,7 +193,7 @@
function onIdentificationOptionsSubmit() { function onIdentificationOptionsSubmit() {
var page = $(this).parents('.editorContent'); var page = $(this).parents('paper-dialog');
submitIdentficationResult(page); submitIdentficationResult(page);
return false; return false;
@ -273,7 +273,7 @@
$('.identifyProviderIds', page).html(html).trigger('create'); $('.identifyProviderIds', page).html(html).trigger('create');
$('.identificationHeader', page).html(Globalize.translate('HeaderIdentify')); page.querySelector('.dialogHeaderTitle').innerHTML = Globalize.translate('HeaderIdentify');
}); });
} }
@ -294,14 +294,7 @@
var dlg = paperDialogHelper.createDialog(); var dlg = paperDialogHelper.createDialog();
var html = ''; var html = '';
html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" mini class="btnCloseDialog"></paper-fab>';
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + Globalize.translate('HeaderIdentifyItem') + '</div>';
html += '</h2>';
html += '<div class="editorContent">';
html += Globalize.translateDocument(template); html += Globalize.translateDocument(template);
html += '</div>';
dlg.innerHTML = html; dlg.innerHTML = html;
document.body.appendChild(dlg); document.body.appendChild(dlg);
@ -311,10 +304,9 @@
paperDialogHelper.open(dlg); paperDialogHelper.open(dlg);
var editorContent = dlg.querySelector('.editorContent'); initEditor(dlg);
initEditor(editorContent);
$('.btnCloseDialog', dlg).on('click', function () { $('.btnCancel', dlg).on('click', function () {
paperDialogHelper.close(dlg); paperDialogHelper.close(dlg);
}); });

View File

@ -1,4 +1,10 @@
<form class="popupIdentifyForm" style="margin:auto;"> <div class="dialogHeader">
<paper-icon-button icon="close" class="btnCancel"></paper-icon-button>
<div class="dialogHeaderTitle">
</div>
</div>
<form class="popupIdentifyForm" style="margin:auto;">
<p>${HeaderIdentifyItemHelp}</p> <p>${HeaderIdentifyItemHelp}</p>

View File

@ -127,12 +127,9 @@
var html = ''; var html = '';
html += '<form style="max-width:100%;">'; html += '<form style="margin:auto;">';
html += '<br />';
html += '<div class="fldSelectPlaylist">'; html += '<div class="fldSelectPlaylist">';
html += '<br />';
html += '<label for="selectPlaylistToAddTo">' + Globalize.translate('LabelSelectPlaylist') + '</label>'; html += '<label for="selectPlaylistToAddTo">' + Globalize.translate('LabelSelectPlaylist') + '</label>';
html += '<select id="selectPlaylistToAddTo" data-mini="true"></select>'; html += '<select id="selectPlaylistToAddTo" data-mini="true"></select>';
html += '</div>'; html += '</div>';
@ -202,29 +199,28 @@
}); });
var html = ''; var html = '';
html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" mini class="btnCloseDialog"></paper-fab>';
var title = Globalize.translate('HeaderAddToPlaylist'); var title = Globalize.translate('HeaderAddToPlaylist');
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + title + '</div>'; html += '<div class="dialogHeader">';
html += '</h2>'; html += '<paper-icon-button icon="close" class="btnCancel"></paper-icon-button>';
html += '<div class="dialogHeaderTitle">';
html += '<div class="editorContent" style="max-width:800px;margin:auto;">'; html += title;
html += getEditorHtml();
html += '</div>'; html += '</div>';
html += '</div>';
html += getEditorHtml();
dlg.innerHTML = html; dlg.innerHTML = html;
document.body.appendChild(dlg); document.body.appendChild(dlg);
var editorContent = dlg.querySelector('.editorContent'); initEditor(dlg, items);
initEditor(editorContent, items);
$(dlg).on('iron-overlay-closed', onDialogClosed); $(dlg).on('iron-overlay-closed', onDialogClosed);
paperDialogHelper.open(dlg); paperDialogHelper.open(dlg);
$('.btnCloseDialog', dlg).on('click', function () { $('.btnCancel', dlg).on('click', function () {
paperDialogHelper.close(dlg); paperDialogHelper.close(dlg);
}); });

View File

@ -572,7 +572,7 @@ paper-dialog paper-radio-group paper-radio-button {
div.dialogHeader { div.dialogHeader {
margin: 0 0 2.5em!important; margin: 0 0 2.5em!important;
padding: .35em 1em; padding: .35em .5em;
background-color: #101010; background-color: #101010;
display: flex; display: flex;
align-items: center; align-items: center;