summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-11 06:26:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-11 06:26:03 +0000
commit3da6062d7eb55f98c61e42216915e0e0f1d85af1 (patch)
treea27fb9cf65973ba6df7556f59ab9064b2ca0c985
parent5adc6a5c9f59946d6ac0588cc9052012784d7b0a (diff)
downloadredmine-3da6062d7eb55f98c61e42216915e0e0f1d85af1.tar.gz
redmine-3da6062d7eb55f98c61e42216915e0e0f1d85af1.zip
Keep the "new object" drop down open when the + sign was clicked (#15880).
For touch displays where :hover does not exist. Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@15504 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine.rb3
-rw-r--r--public/javascripts/application.js9
-rw-r--r--public/stylesheets/application.css2
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/redmine.rb b/lib/redmine.rb
index bed89ef68..d75cfd336 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -226,7 +226,8 @@ Redmine::MenuManager.map :admin_menu do |menu|
end
Redmine::MenuManager.map :project_menu do |menu|
- menu.push :new_object, nil, :caption => ' + '
+ menu.push :new_object, nil, :caption => ' + ',
+ :html => { :id => 'new-object', :onclick => 'toggleNewObjectDropdown(); return false;' }
menu.push :new_issue_category, {:controller => 'issue_categories', :action => 'new'}, :param => :project_id, :caption => :label_issue_category_new,
:parent => :new_object
menu.push :new_version, {:controller => 'versions', :action => 'new'}, :param => :project_id, :caption => :label_version_new,
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 347611bb2..eedeae08b 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -725,6 +725,15 @@ function toggleDisabledInit() {
$('input[data-disables], input[data-enables], input[data-shows]').each(toggleDisabledOnChange);
}
+function toggleNewObjectDropdown() {
+ var dropdown = $('#new-object + ul.menu-children');
+ if(dropdown.hasClass('visible')){
+ dropdown.removeClass('visible');
+ }else{
+ dropdown.addClass('visible');
+ }
+}
+
(function ( $ ) {
// detect if native date input is supported
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index c6d6e4c05..3ab2eccf2 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -51,7 +51,7 @@ pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;}
padding: 4px 10px 4px 10px;
}
#main-menu li a:hover {background:#759FCF; color:#fff;}
-#main-menu li:hover ul.menu-children {display: block;}
+#main-menu li:hover ul.menu-children, #main-menu li ul.menu-children.visible {display: block;}
#main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;}
#main-menu li a.new-object { background-color:#759FCF; }