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=" |
|
|
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,11 +68,9 b'' | |||
|
68 | 68 | } |
|
69 | 69 | |
|
70 | 70 | $('#browser-notification-status').text(browserStatus); |
|
71 |
} |
|
|
71 | } | |
|
72 | 72 | |
|
73 | checkBrowserStatus(); | |
|
74 | ||
|
75 | $('#test-notification').on('click', function(e){ | |
|
73 | ctrlr.testNotifications = function(event){ | |
|
76 | 74 | var levels = ['info', 'error', 'warning', 'success']; |
|
77 | 75 | var level = levels[Math.floor(Math.random()*levels.length)]; |
|
78 | 76 | var payload = { |
@@ -83,6 +81,7 b'' | |||
|
83 | 81 | } |
|
84 | 82 | }; |
|
85 | 83 | $.Topic('/notifications').publish(payload); |
|
86 | }) | |
|
84 | } | |
|
85 | ||
|
87 | 86 | </script> |
|
88 | 87 | </template> |
General Comments 0
You need to be logged in to leave comments.
Login now