Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

back out changes that broke track close buttons

  • Loading branch information...
commit 2ccc548cab0cc31a17ef0b639dc5945d2c248859 1 parent 825e56d
Lincoln Stein authored
Showing with 22 additions and 19 deletions.
  1. +22 −19 htdocs/js/buttons.js
41 htdocs/js/buttons.js
View
@@ -34,26 +34,29 @@ function gbToggleTrack (track_name) {
function ShowHideTrack(track_name,visible) {
var track_title = $(track_name+'_check');
var track_img = $(track_name+'_img');
- if (track_title == null) return;
- var ancestor = track_title.ancestors().find(
- function (el) {
- return el.nodeName == 'TD'
- });
- if (visible == null) {
- visible = !ancestor.hasClassName('activeTrack');
- }
- if (visible) {
- ancestor.addClassName('activeTrack');
- track_title.addClassName('activeTrack');
- track_img.src=Controller.button_url('check.png');
- } else {
- ancestor.removeClassName('activeTrack');
- track_title.removeClassName('activeTrack');
- track_img.src=Controller.button_url('square.png');
- }
- checkSummaries();
- _checkAllToggles(track_title);
+ if (track_title) {
+ var ancestor = track_title.ancestors().find(
+ function (el) {
+ return el.nodeName == 'TD'
+ });
+ if (visible == null) {
+ visible = !ancestor.hasClassName('activeTrack');
+ }
+ if (visible) {
+ ancestor.addClassName('activeTrack');
+ track_title.addClassName('activeTrack');
+ track_img.src=Controller.button_url('check.png');
+ } else {
+ ancestor.removeClassName('activeTrack');
+ track_title.removeClassName('activeTrack');
+ track_img.src=Controller.button_url('square.png');
+ }
+
+ checkSummaries();
+ _checkAllToggles(track_title);
+ }
+ else if (visible == null) return false;
if (visible && !Controller.track_exists(track_name)) {
Controller.add_track(track_name);
Please sign in to comment.
Something went wrong with that request. Please try again.