Problems with context menu in Easy

This commit is contained in:
karel.picman@lbcfree.net 2020-05-20 14:22:36 +02:00
parent cfa997c8b8
commit afc81d3046
3 changed files with 15 additions and 7 deletions

View File

@ -22,6 +22,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<% if defined?(EasyExtensions) %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'context_menu', 'application', defer: true %>
<% end %>
<% end %>
<% html_title l(:dmsf) %>
<div class="contextual">
<% if @file_manipulation_allowed && !@locked_for_user && !@system_folder %>

View File

@ -20,6 +20,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<% if defined?(EasyExtensions) %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'context_menu', 'application', defer: true %>
<% end %>
<% end %>
<% html_title l(:dmsf) %>
<h2><%= l(:link_trash_bin) %></h2>

View File

@ -23,18 +23,14 @@ module RedmineDmsf
include Redmine::Hook
class DmsfViewListener < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context={})
return unless /^(Dmsf|Projects|Issues)/.match?(context[:controller].class.name)
meta = "\n".html_safe + stylesheet_link_tag('redmine_dmsf.css', plugin: :redmine_dmsf) +
return unless context[:controller].class.name.match?(/^(Dmsf|Projects)/)
"\n".html_safe + stylesheet_link_tag('redmine_dmsf.css', plugin: :redmine_dmsf) +
"\n".html_safe + stylesheet_link_tag('select2.min.css', plugin: :redmine_dmsf) +
"\n".html_safe + javascript_include_tag('select2.min.js', plugin: :redmine_dmsf, defer: true) +
"\n".html_safe + javascript_include_tag('redmine_dmsf.js', plugin: :redmine_dmsf, defer: true) +
"\n".html_safe + javascript_include_tag('attachments_dmsf.js', plugin: :redmine_dmsf, defer: true)
if defined?(EasyExtensions) && /^Dmsf/.match?(context[:controller].class.name)
meta << "\n".html_safe + javascript_include_tag('context_menu', 'application', defer: true)
end
meta
end
end