From 02e6f7815346df2ee483fb777975b9212172e6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= Date: Fri, 15 May 2015 17:52:51 +0200 Subject: [PATCH] Handle talks on the scheduler table as links Previously the link functionality (open in window or tab) of those talks was done via javascript. Because of that they couldn't be selected via right click to be opened in a tab, copied or bookmarked. By embedding the talk items into a link element and adding some css to hide the link effects, like hover and underline, we get the desired behaviour without changing it's appearance. --- app/assets/stylesheets/osem-schedule.css.scss | 6 ++ app/views/conference/_schedule_item.html.erb | 74 +++++++------------ 2 files changed, 33 insertions(+), 47 deletions(-) diff --git a/app/assets/stylesheets/osem-schedule.css.scss b/app/assets/stylesheets/osem-schedule.css.scss index b63616cc..fe4875e6 100644 --- a/app/assets/stylesheets/osem-schedule.css.scss +++ b/app/assets/stylesheets/osem-schedule.css.scss @@ -59,3 +59,9 @@ background-image: -webkit-gradient( .schedule-subtitle { color: rgb(185, 74, 72); } + +a.unstyled-link { + text-decoration: none; + color: #333333; + outline: 0; +} diff --git a/app/views/conference/_schedule_item.html.erb b/app/views/conference/_schedule_item.html.erb index bab41cf0..35ccea56 100644 --- a/app/views/conference/_schedule_item.html.erb +++ b/app/views/conference/_schedule_item.html.erb @@ -1,52 +1,32 @@ - <%- if speaker = event[0].speakers.first %> - <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right", - :alt => speaker.name, - :title => speaker.name, - :style => "padding:8px;" %> - <%- end %> -
- - <%= event[0].title %> - <% unless event[0].subtitle.blank? %> - - <%= event[0].subtitle %> - - <% end %> -
- - - <%= "#{speaker.name}" %> - - <% if event[0].track%> - - - <%= event[0].track.name %> + class="event" role="button"> + + <%- if speaker = event[0].speakers.first %> + <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right", + :alt => speaker.name, + :title => speaker.name, + :style => "padding:8px;" %> + <%- end %> +
+ + <%= event[0].title %> + <% unless event[0].subtitle.blank? %> + + <%= event[0].subtitle %> + + <% end %> +
+ + + <%= "#{speaker.name}" %> - <% end -%> + <% if event[0].track%> + + + <%= event[0].track.name %> + + <% end -%> +
-<%= javascript_tag do %> - jQuery( function($) { - $('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) { - var url = $(this).attr('data-href'); - if (e.which === 1 && e.ctrlKey){ - var win = window.open(url, '_blank'); - win.focus(); - } - else if(e.which === 1) - { - window.location = url; - } - else if(e.which === 2) - { - var win = window.open(url, '_blank'); - win.focus(); - } - }); -}); - -<% end %>