mirror of
https://github.com/TracksApp/tracks.git
synced 2026-04-18 01:59:02 +02:00
further enhance the context menu and fix showing of context menu on ie
This commit is contained in:
parent
e898c39467
commit
dfffbc78c3
5 changed files with 60 additions and 14 deletions
|
|
@ -30,6 +30,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
before_filter :set_session_expiration
|
||||
before_filter :set_time_zone
|
||||
before_filter :set_zindex_counter
|
||||
prepend_before_filter :login_required
|
||||
prepend_before_filter :enable_mobile_content_negotiation
|
||||
after_filter :set_charset
|
||||
|
|
@ -262,5 +263,10 @@ class ApplicationController < ActionController::Base
|
|||
def set_time_zone
|
||||
Time.zone = current_user.prefs.time_zone if logged_in?
|
||||
end
|
||||
|
||||
def set_zindex_counter
|
||||
# this counter can be used to handle the IE z-index bug
|
||||
@z_index_counter = 10
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
href="<%= search_plugin_path %>" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var sfLastUL;
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('ul.sf-menu').superfish({
|
||||
delay: 250,
|
||||
|
|
@ -36,13 +35,16 @@ jQuery(document).ready(function() {
|
|||
speed: 'fast'
|
||||
});
|
||||
jQuery('ul.sf-item-menu').superfish({
|
||||
delay: 250,
|
||||
delay: 100,
|
||||
animation: {opacity:'show',height:'show'},
|
||||
autoArrows: false,
|
||||
dropShadows: false,
|
||||
speed: 'fast',
|
||||
onShow: function() {
|
||||
sfLastUL = this;
|
||||
onBeforeShow: function() {
|
||||
$(this.parent().parent().parent()).addClass("sf-item-selected");
|
||||
},
|
||||
onHide: function() {
|
||||
$(this.parent().parent().parent()).removeClass("sf-item-selected");
|
||||
}
|
||||
});
|
||||
Nifty("div#todo_new_action_container","normal");
|
||||
|
|
|
|||
|
|
@ -5,17 +5,17 @@ suppress_project ||= false
|
|||
suppress_edit_button ||= false
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
@z_index_counter = @z_index_counter - 1 # for IE z-index bug
|
||||
%>
|
||||
<div id="<%= dom_id(todo) %>" class="item-container">
|
||||
<div id="<%= dom_id(todo, 'line') %>">
|
||||
<%= remote_star_icon %>
|
||||
<%= remote_toggle_checkbox unless source_view_is :deferred %>
|
||||
<ul class="sf-menu sf-item-menu"><li><%= image_tag "downarrow.png" %><ul id="ul<%= dom_id(todo) %>">
|
||||
<li><%= link_to_remote("Edit", :url => {:controller => 'todos', :action => 'edit', :id => @todo.id}, :method => 'get', :with => "'#{parameters}'",
|
||||
:before => "$('ul#{dom_id(todo)}').hide(); itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();") %></li>
|
||||
<li><%= link_to_remote "Delete", :url => {:controller => 'todos', :action => 'destroy', :id => @todo.id}, :method => 'delete', :with => "'#{parameters}'", :before => "itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
||||
<li><%= link_to_remote "Defer 1 day", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 1, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}, :before => "itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
||||
<li><%= link_to_remote "Defer 7 days", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 7, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}, :before => "itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
||||
<ul class="sf-menu sf-item-menu"><li style="z-index:<%=@z_index_counter%>"><%= image_tag "downarrow.png", :alt=> "" %><ul id="ul<%= dom_id(todo) %>">
|
||||
<li><%= link_to_remote("Edit", :url => {:controller => 'todos', :action => 'edit', :id => @todo.id}, :method => 'get', :with => "'#{parameters}'", :before => "$('ul#{dom_id(todo)}').hide(); var itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();") %></li>
|
||||
<li><%= link_to_remote "Delete", :url => {:controller => 'todos', :action => 'destroy', :id => @todo.id}, :method => 'delete', :with => "'#{parameters}'", :before => "$('ul#{dom_id(todo)}').hide(); var itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
||||
<li><%= link_to_remote "Defer 1 day", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 1, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}, :before => "$('ul#{dom_id(todo)}').hide(); var itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
||||
<li><%= link_to_remote "Defer 7 days", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 7, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}, :before => "$('ul#{dom_id(todo)}').hide(); var itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
||||
</ul></ul>
|
||||
<div class="description<%= staleness_class( todo ) %>">
|
||||
<%= date_span -%>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue