##// END OF EJS Templates
toasts: hide messages on escape.
marcink -
r1486:06061388 default
parent child Browse files
Show More
@@ -1,5 +1,6 b''
1 <link rel="import" href="../../../../../../bower_components/paper-button/paper-button.html">
1 <link rel="import" href="../../../../../../bower_components/paper-button/paper-button.html">
2 <link rel="import" href="../../../../../../bower_components/paper-toast/paper-toast.html">
2 <link rel="import" href="../../../../../../bower_components/paper-toast/paper-toast.html">
3 <link rel="import" href="../../../../../../bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
3 <link rel="import" href="../rhodecode-unsafe-html/rhodecode-unsafe-html.html">
4 <link rel="import" href="../rhodecode-unsafe-html/rhodecode-unsafe-html.html">
4 <dom-module id="rhodecode-toast">
5 <dom-module id="rhodecode-toast">
5 <template>
6 <template>
@@ -14,12 +14,29 b' Polymer({'
14 hasToasts: {
14 hasToasts: {
15 type: Boolean,
15 type: Boolean,
16 computed: '_computeHasToasts(toasts.*)'
16 computed: '_computeHasToasts(toasts.*)'
17 },
18 keyEventTarget: {
19 type: Object,
20 value: function() {
21 return document.body;
22 }
17 }
23 }
18 },
24 },
25 behaviors: [
26 Polymer.IronA11yKeysBehavior
27 ],
19 observers: [
28 observers: [
20 '_changedToasts(toasts.splices)'
29 '_changedToasts(toasts.splices)'
21 ],
30 ],
22
31
32 keyBindings: {
33 'esc:keyup': '_hideOnEsc'
34 },
35
36 _hideOnEsc: function (event) {
37 return this.dismissNotifications();
38 },
39
23 _computeHasToasts: function(){
40 _computeHasToasts: function(){
24 return this.toasts.length > 0;
41 return this.toasts.length > 0;
25 },
42 },
General Comments 0
You need to be logged in to leave comments. Login now