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