mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
make dialogs stackable
This commit is contained in:
parent
540cf73496
commit
52773c577f
2 changed files with 9 additions and 11 deletions
|
@ -50,11 +50,9 @@
|
|||
to {transform: rotate(360deg);}
|
||||
}
|
||||
|
||||
#nbalert {
|
||||
display: none;
|
||||
div.nbalert {
|
||||
position: absolute;
|
||||
text-align: left;
|
||||
z-index: 10000;
|
||||
white-space: pre-wrap;
|
||||
left: 33%;
|
||||
top: 250px;
|
||||
|
|
|
@ -88,14 +88,16 @@ function mqttSend( topic, ptr ) {
|
|||
}
|
||||
|
||||
function nbDialog(msg, buttons, proc, closure) {
|
||||
let dlg = document.getElementById('nbalert');
|
||||
while (dlg.firstChild) {
|
||||
dlg.removeChild(dlg.firstChild);
|
||||
}
|
||||
let container = document.getElementById('nbalert');
|
||||
|
||||
let dlg = document.createElement('div');
|
||||
dlg.classList.add('nbalert');
|
||||
dlg.style.zIndex = 10000;
|
||||
container.appendChild( dlg );
|
||||
|
||||
let txtDiv = document.createElement('div');
|
||||
txtDiv.textContent = msg
|
||||
dlg.appendChild( txtDiv );
|
||||
txtDiv.textContent = msg
|
||||
|
||||
let span = document.createElement('div');
|
||||
span.classList.add('buttonRow');
|
||||
|
@ -105,13 +107,11 @@ function nbDialog(msg, buttons, proc, closure) {
|
|||
button.onclick = function() {
|
||||
Module.ccall('onDlgButton', null, ['number', 'number', 'string'],
|
||||
[proc, closure, buttonTxt]);
|
||||
dlg.style.display = 'none'; // hide
|
||||
container.removeChild(dlg);
|
||||
};
|
||||
span.appendChild( button );
|
||||
}
|
||||
dlg.appendChild( span );
|
||||
|
||||
dlg.style.display = 'block'; // reveal
|
||||
}
|
||||
|
||||
for ( let one of ['paho-mqtt.js'] ) {
|
||||
|
|
Loading…
Reference in a new issue