Urls working.

This commit is contained in:
cahrens
2013-03-20 16:37:08 -04:00
parent 10ac7e04f8
commit 6d6e144c35
8 changed files with 71 additions and 40 deletions

View File

@@ -45,7 +45,8 @@
<% if (item['action_text'] !== '' && item['action_url'] !== '') { %>
<ul class="list-actions task-actions">
<li>
<a href="<%= item['action_url'] %>" class="action action-primary"><%= item['action_text'] %></a>
<a href="<%= item['action_url'] %>" rel="external" class="action action-primary"
title="This link will open in a new browser window/tab"><%= item['action_text'] %></a>
</li>
</ul>
<% } %>

View File

@@ -5,7 +5,8 @@ CMS.Views.Checklists = Backbone.View.extend({
events : {
'click .course-checklist .checklist-title' : "toggleChecklist",
'click .course-checklist .task input' : "toggleTask"
'click .course-checklist .task input' : "toggleTask",
'click a[rel="external"]' : "openInNewTab"
},
initialize : function() {
@@ -60,7 +61,7 @@ CMS.Views.Checklists = Backbone.View.extend({
},
toggleChecklist : function(e) {
(e).preventDefault();
e.preventDefault();
$(e.target).closest('.course-checklist').toggleClass('is-collapsed');
},
@@ -84,6 +85,11 @@ CMS.Views.Checklists = Backbone.View.extend({
},
error : CMS.ServerError
});
},
openInNewTab : function(e) {
e.preventDefault();
window.open($(e.target).attr('href'));
}
});