Fixed <loot-dialog>.

The issues seem to have been due to the layered attribute being true by
default in Polymer 0.5.0. The layering complicates matters (it moves
dialogs into shadow DOM), and I don't think I need it, so it's been
disabled. I also removed the open property, as it conflicts with an
existing function name.
This commit is contained in:
Oliver Hamlet
2014-11-12 20:33:19 +00:00
parent cfa4677516
commit bfa52e155c
2 changed files with 7 additions and 14 deletions
+5 -12
View File
@@ -11,30 +11,23 @@ Still missing compared to <dialog> are:
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.html">
<polymer-element name="loot-dialog" extends="paper-action-dialog" attributes="open" transition="core-transition-center" autoCloseDisabled backdrop>
<polymer-element name="loot-dialog" extends="paper-action-dialog" transition="core-transition-center" layered="false">
<script>
Polymer({
open: false,
openedChanged: function(oldValue, newValue) {
this.open = newValue;
},
openChanged: function(oldValue, newValue) {
this.opened = newValue;
},
show: function() {
this.backdrop = false;
this.autoCloseDisabled = false;
this.setAttribute(opened, true);
},
showModal: function() {
this.backdrop = true;
this.autoCloseDisabled = true;
this.open();
this.setAttribute('opened', true);
},
close: function(retVal) {
this.setAttribute('returnValue', retVal);
this.removeAttribute(opened);
this.super();
},
});
</script>
+2 -2
View File
@@ -686,14 +686,14 @@ function showProgress(message) {
if (message) {
progressDialog.getElementsByTagName('h1')[0].textContent = message;
}
if (!progressDialog.open) {
if (!progressDialog.opened) {
progressDialog.showModal();
progressDialog.querySelector('.progress').classList.toggle('running');
}
}
function closeProgressDialog() {
var progressDialog = document.getElementById('progressDialog');
if (progressDialog.open) {
if (progressDialog.opened) {
progressDialog.close();
progressDialog.querySelector('.progress').classList.toggle('running');
}