##// END OF EJS Templates
my_account: fix test notifications for IE10+
ergo -
r777:5a8d261e default
parent child Browse files
Show More
@@ -28,7 +28,7 b''
28 28 </div>
29 29 </div>
30 30 <div class="buttons">
31 <a class="btn btn-default" id="test-notification">Test notification</a>
31 <a class="btn btn-default" id="test-notification" on-tap="testNotifications">Test notification</a>
32 32 </div>
33 33 </div>
34 34 </div>
@@ -36,7 +36,7 b''
36 36 </div>
37 37 </div>
38 38
39 <script type="application/javascript">
39 <script type="text/javascript">
40 40 /** because im not creating a custom element for this page
41 41 * we need to push the function onto the dom-template
42 42 * ideally we turn this into notification-settings elements
@@ -68,21 +68,20 b''
68 68 }
69 69
70 70 $('#browser-notification-status').text(browserStatus);
71 };
72
73 checkBrowserStatus();
71 }
74 72
75 $('#test-notification').on('click', function(e){
76 var levels = ['info', 'error', 'warning', 'success'];
77 var level = levels[Math.floor(Math.random()*levels.length)];
78 var payload = {
79 message: {
80 message: 'This is a test notification.',
81 level: level,
82 force: true
83 }
84 };
85 $.Topic('/notifications').publish(payload);
86 })
73 ctrlr.testNotifications = function(event){
74 var levels = ['info', 'error', 'warning', 'success'];
75 var level = levels[Math.floor(Math.random()*levels.length)];
76 var payload = {
77 message: {
78 message: 'This is a test notification.',
79 level: level,
80 force: true
81 }
82 };
83 $.Topic('/notifications').publish(payload);
84 }
85
87 86 </script>
88 87 </template>
General Comments 0
You need to be logged in to leave comments. Login now