##// 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 1 <link rel="import" href="../../../../../../bower_components/paper-button/paper-button.html">
2 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 4 <link rel="import" href="../rhodecode-unsafe-html/rhodecode-unsafe-html.html">
4 5 <dom-module id="rhodecode-toast">
5 6 <template>
@@ -14,12 +14,29 b' Polymer({'
14 14 hasToasts: {
15 15 type: Boolean,
16 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 28 observers: [
20 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 40 _computeHasToasts: function(){
24 41 return this.toasts.length > 0;
25 42 },
General Comments 0
You need to be logged in to leave comments. Login now