lib/dynamic_menu.rb in dynamic_menu-2.0.0 vs lib/dynamic_menu.rb in dynamic_menu-2.0.2
- old
+ new
@@ -10,32 +10,16 @@
if method==:delete
genlink += "<a href=\"#{link}\" data-confirm=\"#{confirm}\" data-method=\"delete\" rel=\"nofollow\">
#{name}</a>".html_safe
elsif link==:submit
- genlink += "<a href=\"#\" onclick=\"$('form').submit(); return false;\">#{name}</a>".html_safe
- genlink += "<script type=\"text/javascript\">
- $(document).ready(function(){
- $('html').keypress(function(e){
- if(e.which == 13){
- $('form').submit();
- return false;
- }
- });
- });</script>".html_safe
+ genlink += "<a href=\"#\" data-submit=\"true\">#{name}</a>".html_safe
elsif link == :back
- genlink = "<a href=\"#\" id=\"jcheats-back\">#{name}</a>".html_safe
- genlink += "<script type=\"text/javascript\">
- $(\"#jcheats-back\").live(\"click\",
- function(){
- var ref = document.referrer;
- document.location=ref;
- });
- </script>".html_safe
+ genlink = "<a href=\"#\" data-back=\"true\">#{name}</a>".html_safe
else
genlink = "<a href=\"#{link}\">#{name}</a>".html_safe
end
- @actionMenuItems << genlink
+ @actionMenuItems << genlink.html_safe
end
end
end