Use Brian's open external method.
This commit is contained in:
@@ -167,10 +167,15 @@ function linkSmoothScroll(e) {
|
||||
}
|
||||
|
||||
function linkNewWindow(e) {
|
||||
window.open($(this).attr('href'));
|
||||
window.open($(e.target).attr('href'));
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// On AWS instances, base.js gets wrapped in a separate scope as part of Django static
|
||||
// pipelining (note, this doesn't happen on local runtimes). So if we set it on window,
|
||||
// when we can access it from other scopes (namely the checklists)
|
||||
window.cmsLinkNewWindow = linkNewWindow;
|
||||
|
||||
function toggleSections(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ CMS.Views.Checklists = Backbone.View.extend({
|
||||
events : {
|
||||
'click .course-checklist .checklist-title' : "toggleChecklist",
|
||||
'click .course-checklist .task input' : "toggleTask",
|
||||
'click a[rel="external"]' : "openInNewTab"
|
||||
'click a[rel="external"]' : window.cmsLinkNewWindow
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
@@ -85,11 +85,5 @@ CMS.Views.Checklists = Backbone.View.extend({
|
||||
},
|
||||
error : CMS.ServerError
|
||||
});
|
||||
},
|
||||
|
||||
openInNewTab : function(e) {
|
||||
e.preventDefault();
|
||||
window.open($(e.target).attr('href'));
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user