Skip to content

Instantly share code, notes, and snippets.

@mileszs
Created December 15, 2009 22:47
Show Gist options
  • Select an option

  • Save mileszs/257380 to your computer and use it in GitHub Desktop.

Select an option

Save mileszs/257380 to your computer and use it in GitHub Desktop.
setupIndex: function() {
rows = $$('tr.deviceSummary');
for (var i=0; i<rows.length; i++) {
rows[i].onclick = function() {
window.location.href = '/devices/' + this.id.substr(1);
}.bind(rows[i]);
}
$('new_device').observe('click', Devices.showMiniNewForm.bindAsEventListener(this));
Devices.setupAll();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment