Merge pull request #1333 from opf/bugfix/restore-legacy-actions-positioning

Restore positioning of legacy action menu
pull/1337/merge
manwithtwowatches 11 years ago
commit 21d23a52e0
  1. 2
      app/assets/javascripts/action_menu.js
  2. 86
      app/assets/stylesheets/content/_legacy_actions.sass
  3. 1
      app/assets/stylesheets/default.css.sass
  4. 4
      app/views/layouts/_action_menu_base.html.erb
  5. 4
      test/functional/repositories_controller_test.rb

@ -88,7 +88,7 @@ jQuery(function ($) {
});
}
$('.action_menu_main, .action_menu_specific').each(function(idx, menu){
$('.legacy-actions-main, .legacy-actions-specific').each(function(idx, menu){
install_menu_logic($(menu));
});
});

@ -0,0 +1,86 @@
/*-- copyright
* OpenProject is a project management system.
* Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 3.
*
* OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
* Copyright (C) 2006-2013 Jean-Philippe Lang
* Copyright (C) 2010-2013 the ChiliProject Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* See doc/COPYRIGHT.rdoc for more details. ++
*/
@mixin legacy_actions_defaults($margin-top: 7px)
float: right
margin-top: $margin-top
> li
float: left
position: relative
list-style: none
@mixin contextual($margin-top: 8px)
float: right
white-space: nowrap
line-height: 1.4em
margin-top: $margin-top
padding-left: 10px
ul.legacy-actions-main
@include legacy_actions_defaults
ul.legacy-actions-specific,
.nosidebar ul.legacy-actions-specific
@include legacy_actions_defaults(-34px)
p.subtitle + ul.legacy-actions-specific
@include legacy_actions_defaults(-57px)
ul.legacy-actions-more
position: absolute
top: 23px
right: 0px
z-index: 100
white-space: nowrap
padding: 10px
padding-top: 5px
background: white
border: 1px solid #B7B7B7
box-shadow: 1px 1px 2px #aaa
> li
padding-top: 5px
#lower-title-bar ul.legacy-actions-specific
@include legacy_actions_defaults
padding-top: 10px
#lower-title-bar ul.legacy-actions-more
bottom: 0
right: 0
margin-bottom: 25px
top: auto
> li.drop-down
position: relative
.message-reply-menu
@include contextual(-39px)

@ -48,6 +48,7 @@
@import content/wiki
@import content/links
@import content/action_menu_main
@import content/legacy_actions
@import content/my_page
@import content/buttons
@import content/boxes

@ -28,7 +28,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% action_menu_key = action_menu_key ? action_menu_key : :action_menu_main %>
<ul class="<%= action_menu_key.to_s %>">
<ul class="<%= action_menu_key %> <%= action_menu_key.to_s.gsub('action_menu_', 'legacy-actions-') %>">
<%= content_for action_menu_key %>
<% if content_for?(:action_menu_more) %>
<li class="drop-down">
@ -36,7 +36,7 @@ See doc/COPYRIGHT.rdoc for more details.
accesskey="<%= OpenProject::AccessKeys.key_for(:more_menu) %>">
<%= l(:more_actions) %>
</a>
<ul class="action_menu_more" style="display:none;">
<ul class="action_menu_more legacy-actions-more" style="display:none;">
<%= content_for :action_menu_more %>
</ul>
</li>

@ -61,13 +61,13 @@ class RepositoriesControllerTest < ActionController::TestCase
get :revision, {:project_id => 1, :rev => 1}
assert_response :success
assert_template 'revision'
assert_no_tag :tag => "ul", :attributes => { :class => "action_menu_specific" },
assert_no_tag :tag => "ul", :attributes => { :class => /action_menu_specific/ },
:child => { :tag => "a", :attributes => { :href => @controller.url_for(:only_path => true,
:controller => 'repositories',
:action => 'revision',
:project_id => 'ecookbook',
:rev => '0') } }
assert_tag :tag => "ul", :attributes => { :class => "action_menu_specific" },
assert_tag :tag => "ul", :attributes => { :class => /action_menu_specific/ },
:child => { :tag => "a", :attributes => { :href => @controller.url_for(:only_path => true,
:controller => 'repositories',
:action => 'revision',

Loading…
Cancel
Save