mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 15:50:13 +01: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_session_expiration
|
||||||
before_filter :set_time_zone
|
before_filter :set_time_zone
|
||||||
|
before_filter :set_zindex_counter
|
||||||
prepend_before_filter :login_required
|
prepend_before_filter :login_required
|
||||||
prepend_before_filter :enable_mobile_content_negotiation
|
prepend_before_filter :enable_mobile_content_negotiation
|
||||||
after_filter :set_charset
|
after_filter :set_charset
|
||||||
|
|
@ -263,4 +264,9 @@ class ApplicationController < ActionController::Base
|
||||||
Time.zone = current_user.prefs.time_zone if logged_in?
|
Time.zone = current_user.prefs.time_zone if logged_in?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_zindex_counter
|
||||||
|
# this counter can be used to handle the IE z-index bug
|
||||||
|
@z_index_counter = 10
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
href="<%= search_plugin_path %>" />
|
href="<%= search_plugin_path %>" />
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var sfLastUL;
|
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery('ul.sf-menu').superfish({
|
jQuery('ul.sf-menu').superfish({
|
||||||
delay: 250,
|
delay: 250,
|
||||||
|
|
@ -36,13 +35,16 @@ jQuery(document).ready(function() {
|
||||||
speed: 'fast'
|
speed: 'fast'
|
||||||
});
|
});
|
||||||
jQuery('ul.sf-item-menu').superfish({
|
jQuery('ul.sf-item-menu').superfish({
|
||||||
delay: 250,
|
delay: 100,
|
||||||
animation: {opacity:'show',height:'show'},
|
animation: {opacity:'show',height:'show'},
|
||||||
autoArrows: false,
|
autoArrows: false,
|
||||||
dropShadows: false,
|
dropShadows: false,
|
||||||
speed: 'fast',
|
speed: 'fast',
|
||||||
onShow: function() {
|
onBeforeShow: function() {
|
||||||
sfLastUL = this;
|
$(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");
|
Nifty("div#todo_new_action_container","normal");
|
||||||
|
|
|
||||||
|
|
@ -5,17 +5,17 @@ suppress_project ||= false
|
||||||
suppress_edit_button ||= false
|
suppress_edit_button ||= false
|
||||||
parameters = "_source_view=#{@source_view}"
|
parameters = "_source_view=#{@source_view}"
|
||||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
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) %>" class="item-container">
|
||||||
<div id="<%= dom_id(todo, 'line') %>">
|
<div id="<%= dom_id(todo, 'line') %>">
|
||||||
<%= remote_star_icon %>
|
<%= remote_star_icon %>
|
||||||
<%= remote_toggle_checkbox unless source_view_is :deferred %>
|
<%= 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) %>">
|
<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}'",
|
<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>
|
||||||
: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 => "$('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 => "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 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 => "$('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 => "itemContainer = this.up('.item-container'); itemContainer.startWaiting()", :complete => "itemContainer.stopWaiting();" %></li>
|
|
||||||
</ul></ul>
|
</ul></ul>
|
||||||
<div class="description<%= staleness_class( todo ) %>">
|
<div class="description<%= staleness_class( todo ) %>">
|
||||||
<%= date_span -%>
|
<%= date_span -%>
|
||||||
|
|
|
||||||
|
|
@ -357,6 +357,10 @@ div.item-container {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-selected {
|
||||||
|
background: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
a.recurring_icon {
|
a.recurring_icon {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|
@ -375,13 +379,12 @@ input.item-checkbox {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description, .stale_l1, .stale_l2, .stale_l3 {
|
||||||
margin-left: 50px;
|
margin-left: 60px;
|
||||||
position:relative
|
position:relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stale_l1, .stale_l2, .stale_l3 {
|
.stale_l1, .stale_l2, .stale_l3 {
|
||||||
margin-left: 82px;
|
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,24 @@
|
||||||
top: -999em;
|
top: -999em;
|
||||||
width: 12em; /* left offset of submenus need to match (see below) */
|
width: 12em; /* left offset of submenus need to match (see below) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-menu ul {
|
||||||
|
width: 8em;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
.sf-menu ul li {
|
.sf-menu ul li {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.sf-menu li:hover {
|
.sf-menu li:hover {
|
||||||
visibility: inherit; /* fixes IE7 'sticky bug' */
|
visibility: inherit; /* fixes IE7 'sticky bug' */
|
||||||
}
|
}
|
||||||
|
|
||||||
.sf-menu li {
|
.sf-menu li {
|
||||||
float: left;
|
float: left;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sf-menu a {
|
.sf-menu a {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -63,6 +71,7 @@ ul.sf-menu li li li.sfHover ul {
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sf-menu a, .sf-menu a:visited, .sf-menu ul li a { /* visited pseudo selector so IE6 applies text colour*/
|
.sf-menu a, .sf-menu a:visited, .sf-menu ul li a { /* visited pseudo selector so IE6 applies text colour*/
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
|
@ -71,11 +80,22 @@ ul.sf-menu li li li.sfHover ul {
|
||||||
border-bottom: 4px solid #000; /* make sure there is enough room for the solid */
|
border-bottom: 4px solid #000; /* make sure there is enough room for the solid */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-menu a, .sf-item-menu a:visited, .sf-item-menu ul li a {
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 10px;
|
||||||
|
color: #000;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
.sf-menu li li, .sf-menu li ul {
|
.sf-menu li li, .sf-menu li ul {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: #000000;
|
background: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-menu li li, .sf-item-menu li ul {
|
||||||
|
background: #CCC;
|
||||||
|
}
|
||||||
|
|
||||||
.sf-menu li ul {
|
.sf-menu li ul {
|
||||||
margin-top: -18px;
|
margin-top: -18px;
|
||||||
padding: 0 8px 9px 0;
|
padding: 0 8px 9px 0;
|
||||||
|
|
@ -90,6 +110,7 @@ ul.sf-menu li li li.sfHover ul {
|
||||||
-moz-border-radius-topright: 8px;
|
-moz-border-radius-topright: 8px;
|
||||||
-webkit-border-top-right-radius: 8px;
|
-webkit-border-top-right-radius: 8px;
|
||||||
-webkit-border-top-left-radius: 8px;
|
-webkit-border-top-left-radius: 8px;
|
||||||
|
border: 2px solid #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sf-menu li ul li, .sf-menu li li {
|
.sf-menu li ul li, .sf-menu li li {
|
||||||
|
|
@ -98,6 +119,10 @@ ul.sf-menu li li li.sfHover ul {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-menu li ul li, .sf-item-menu li li {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
.sf-menu li li li {
|
.sf-menu li li li {
|
||||||
background: #000000;
|
background: #000000;
|
||||||
}
|
}
|
||||||
|
|
@ -107,11 +132,21 @@ ul.sf-menu li li li.sfHover ul {
|
||||||
color: #CCC;
|
color: #CCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-menu li:hover, .sf-item-menu li.sfHover,
|
||||||
|
.sf-item-menu a:focus, .sf-item-menu a:hover, .sf-item-menu a:active {
|
||||||
|
color: #000;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
|
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
|
||||||
border-bottom: 4px solid #CCC;
|
border-bottom: 4px solid #CCC;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-item-menu a:focus, .sf-item-menu a:hover, .sf-item-menu a:active {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
/*** arrows **/
|
/*** arrows **/
|
||||||
.sf-menu a.sf-with-ul {
|
.sf-menu a.sf-with-ul {
|
||||||
padding-right: 2.25em;
|
padding-right: 2.25em;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue