update components
This commit is contained in:
parent
adb3a60373
commit
95b1778220
11 changed files with 171 additions and 74 deletions
|
@ -6,8 +6,13 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
|
|||
removeOnClose: true
|
||||
};
|
||||
|
||||
var backButton = false;
|
||||
var raisedButtons = false;
|
||||
|
||||
if (layoutManager.tv) {
|
||||
dialogOptions.size = 'fullscreen';
|
||||
backButton = true;
|
||||
raisedButtons = true;
|
||||
}
|
||||
|
||||
var dlg = paperdialoghelper.createDialog(dialogOptions);
|
||||
|
@ -17,20 +22,21 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
|
|||
var html = '';
|
||||
var submitValue = '';
|
||||
|
||||
html += '<div style="margin:0;padding:0;width:50%;text-align:left;">';
|
||||
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>';
|
||||
|
||||
if (options.title) {
|
||||
html += '<h1 style="margin-bottom:0;">';
|
||||
html += options.title;
|
||||
html += '</h1>';
|
||||
html += '<div class="promptDialogContent">';
|
||||
if (backButton) {
|
||||
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>';
|
||||
}
|
||||
|
||||
html += '<paper-input autoFocus class="txtPromptValue"></paper-input>';
|
||||
|
||||
// TODO: An actual form element should probably be added
|
||||
html += '<br/>';
|
||||
html += '<paper-button raised class="block paperSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + Globalize.translate('core#ButtonOk') + '</span></paper-button>';
|
||||
if (raisedButtons) {
|
||||
html += '<paper-button raised class="btnSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + Globalize.translate('core#ButtonOk') + '</span></paper-button>';
|
||||
} else {
|
||||
html += '<paper-button class="btnSubmit">' + Globalize.translate('core#ButtonOk') + '</paper-button>';
|
||||
html += '<paper-button class="btnPromptExit">' + Globalize.translate('core#ButtonCancel') + '</paper-button>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
@ -40,9 +46,13 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
|
|||
dlg.querySelector('.txtPromptValue').value = options.text;
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
dlg.querySelector('.txtPromptValue').label = options.title;
|
||||
}
|
||||
|
||||
document.body.appendChild(dlg);
|
||||
|
||||
dlg.querySelector('.paperSubmit').addEventListener('click', function (e) {
|
||||
dlg.querySelector('.btnSubmit').addEventListener('click', function (e) {
|
||||
|
||||
submitValue = dlg.querySelector('.txtPromptValue').value;
|
||||
paperdialoghelper.close(dlg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue