[Fix] Show ajax errors in a dialog
This commit is contained in:
parent
6902da6796
commit
62bbd35604
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "strolch-wc-reports",
|
"name": "strolch-wc-reports",
|
||||||
"description": "Strolch WebComponent Reports",
|
"description": "Strolch WebComponent Reports",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Robert von Burg"
|
"Robert von Burg"
|
||||||
],
|
],
|
||||||
|
@ -20,11 +20,11 @@
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
||||||
"strolchjs": "4treesCH/strolchjs#^0.2.3",
|
"strolchjs": "4treesCH/strolchjs#^0.2.4",
|
||||||
"strolch-wc-styles": "4treesCH/strolch-wc-styles#^0.2.0",
|
"strolch-wc-styles": "4treesCH/strolch-wc-styles#^0.2.0",
|
||||||
"strolch-wc-badge": "4treesCH/strolch-wc-badge#^0.1.0",
|
"strolch-wc-badge": "4treesCH/strolch-wc-badge#^0.1.0",
|
||||||
"strolch-wc-debounced-input": "4treesCH/strolch-wc-debounced-input#^0.1.0",
|
"strolch-wc-debounced-input": "4treesCH/strolch-wc-debounced-input#^0.1.0",
|
||||||
"strolch-wc-localize-behavior": "4treesCH/strolch-wc-localize-behavior#^1.0.2",
|
"strolch-wc-localize-behavior": "4treesCH/strolch-wc-localize-behavior#^1.1.4",
|
||||||
|
|
||||||
"polymer": "Polymer/polymer#^1.11.3",
|
"polymer": "Polymer/polymer#^1.11.3",
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<link rel="import" href="../iron-ajax/iron-ajax.html">
|
<link rel="import" href="../iron-ajax/iron-ajax.html">
|
||||||
<link rel="import" href="../iron-icon/iron-icon.html">
|
<link rel="import" href="../iron-icon/iron-icon.html">
|
||||||
<link rel="import" href="../paper-button/paper-button.html">
|
<link rel="import" href="../paper-button/paper-button.html">
|
||||||
|
<link rel="import" href="../paper-dialog/paper-dialog.html">
|
||||||
<link rel="import" href="../paper-dropdown-menu/paper-dropdown-menu.html">
|
<link rel="import" href="../paper-dropdown-menu/paper-dropdown-menu.html">
|
||||||
<link rel="import" href="../paper-item/paper-item.html">
|
<link rel="import" href="../paper-item/paper-item.html">
|
||||||
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
|
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
|
||||||
|
@ -289,6 +290,15 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<paper-dialog id="dlg" modal>
|
||||||
|
<h2>[[dlgTitle]]</h2>
|
||||||
|
<p>[[dlgText]]</p>
|
||||||
|
<div class="buttons">
|
||||||
|
<paper-button dialog-confirm autofocus>Close</paper-button>
|
||||||
|
</div>
|
||||||
|
</paper-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -359,7 +369,20 @@
|
||||||
observers: [],
|
observers: [],
|
||||||
|
|
||||||
/* Listeners */
|
/* Listeners */
|
||||||
listeners: {},
|
listeners: {
|
||||||
|
"strolch-show-dialog": "onShowDialog"
|
||||||
|
},
|
||||||
|
|
||||||
|
onShowDialog: function (event) {
|
||||||
|
this.showError(event.detail.title, event.detail.text);
|
||||||
|
},
|
||||||
|
showError: function (title, text) {
|
||||||
|
this.dlgTitle = title;
|
||||||
|
this.dlgText = text;
|
||||||
|
console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText);
|
||||||
|
this.$.dlg.open();
|
||||||
|
},
|
||||||
|
|
||||||
onToggleShowFacets: function (event) {
|
onToggleShowFacets: function (event) {
|
||||||
this.showFacets = !this.showFacets;
|
this.showFacets = !this.showFacets;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue