~larry-e-works/uci-engine/amqp-to-kombu

« back to all changes in this revision

Viewing changes to charms/precise/webui/files/webroot/webui_ticket_list.js

  • Committer: Joe Talbott
  • Date: 2014-01-27 14:54:08 UTC
  • mfrom: (126.3.8 webui)
  • mto: This revision was merged to the branch mainline in revision 161.
  • Revision ID: joe.talbott@canonical.com-20140127145408-zpubebx02y6oumxq
merge doanac's cleanup branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI().use('node', 'datatable-mutable', 'webui', function(Y) {
2
 
 
3
 
  var url_prefix = "/api/";
4
 
  var uri = 'api_example.json';
5
 
 
6
 
  Y.webui.make_main_table('#table');
7
 
 
8
 
  Y.delegate('click', function(e) {
9
 
    var target = e.currentTarget;
10
 
    var id = target.ancestor('tr').get('id');
11
 
    var ticket_id = this.getRecord(id).get('ticket_id');
12
 
    var url = "/ticket.html?ticket_id=" + ticket_id;
13
 
 
14
 
    location = url;
15
 
  }, '#table', 'td', Y.webui.main_table); 
16
 
 
17
 
  Y.webui.get_tickets();
18
 
 
19
 
  var refresh_rate = Y.one("#refresh_rate");
20
 
  refresh_timeout = null;
21
 
  refresh_rate.on('change', function(e) {
22
 
    var value = refresh_rate.get('value');
23
 
    if (refresh_timeout) {
24
 
      clearTimeout(refresh_timeout);
25
 
    }
26
 
    interval = parseInt(value) * 1000;
27
 
    Y.webui.update_tickets();
28
 
  });
29
 
 
30
 
});
31
 
 
32
 
/* Unit tests */
33
 
YUI().use('webui', function(Y) {
34
 
 
35
 
});