Skip to content

Commit b835711

Browse files
author
Jason White
committed
Updating comments, removing extraneous code
1 parent 6d64b99 commit b835711

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/main/webapp/js/goatUtil.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -152,33 +152,19 @@ goat.utils = {
152152
return lessonName.replace(/\s|\(|\)|\!|\:|\;|\@|\#|\$|\%|\^|\&|\*/g, '');//TODO move the replace routine into util function
153153
},
154154
ajaxifyAttackHref: function() {
155-
/* Jason I commented this implementation out
156-
* I think we should show the attack link on the lessons that need it by modifying the lesson
157-
* itself or we could add a new button up top for "show lesson link" */
158-
//re-enabling for now ... was breaking external links
155+
// rewrite any links with hrefs point to relative attack URLs
159156
$.each($('a[href^="attack?"]'),
160157
function(i,el) {
161158
var url = $(el).attr('href');
162159
$(el).unbind('click').attr('href','#').attr('link',url);
163160
//TODO pull currentMenuId
164-
$(el).click(
165-
function() {
161+
$(el).click(function() {
162+
event.preventDefault();
166163
var _url = $(el).attr('link');
167164
$.get(_url, {success:showResponse});
168165
}
169166
);
170167
});
171-
172-
// alternate implementation
173-
// unbind any bound events so we are safe to be called twice
174-
/*
175-
$('#lesson_content a').unbind('click');
176-
$('#lesson_content a').bind('click', function(event) {
177-
event.preventDefault();
178-
$.get(this.href, {}, function(response) {
179-
$('#lesson_content').html(response);
180-
});
181-
});*/
182168
}
183169
};
184170

0 commit comments

Comments
 (0)