Guest User

Untitled

a guest
Apr 27th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. // The link ends up always being the very last cabinet
  3. // in the table, rather than the cabinet listed in each row.
  4. // What did I do wrong?
  5.  
  6. clickableCabinets: function() {
  7. rows = $$('tr.cabinetSummary');
  8. for (var i=0; i<rows.length; i++) {
  9. var room = rows[i].select('.cabinetRoom')[0].textContent;
  10. var cabinet = rows[i].select('.cabinetName')[0].textContent;
  11. rows[i].onclick = function() {
  12. window.location.href = '/room/' + room + '/cabinet/' + cabinet;
  13. }.bind(rows[i]);
  14. }
  15. },
Add Comment
Please, Sign In to add comment