changeset 2558:f66a7a76c7b5

Fixed broken links for action, selection and toggle/more options in index page in basic theme as per issue #403 The "Select All", "New Item", "Download", "Delete", "Destroy", "Toggle" and "More" links provided on the index page in the basic theme were not functional due do wrong address of the javascript file "index_action.js" in the corresponding html file "index.html" and faulty Jquery code in "index_action.js". The address originally provided searches for "index_action.js" in the "templates" folder while it is actually present in the "static/js" folder. This patch corrects the address provided in the "index.html". Also the "more" button was fixed to make the extra content-type info always appear on the right side of the checkbox options instead of appearing below them, by using ".fadeIn()" function instead of setting their "display" attribute to "block". Also the non-functional toggle button was fixed by using ".prop()" function to toggle the "checked" property of each checkbox each time the "toggle" button is clicked.
author Ajitesh Gupta <ajgupta93@gmail.com>
date Sun, 16 Feb 2014 23:49:52 +0530
parents 07f3ccfdea45
children b9133a780db8
files MoinMoin/static/js/index_action.js MoinMoin/themes/basic/templates/index.html
diffstat 2 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/js/index_action.js	Sun Feb 09 23:48:41 2014 +0530
+++ b/MoinMoin/static/js/index_action.js	Sun Feb 16 23:49:52 2014 +0530
@@ -248,11 +248,7 @@
     $(".filter-toggle").click(function () {
         // reverse checked/unchecked for each content type
         $(".moin-contenttypes-wrapper form").find("input[type='checkbox']").each(function () {
-            if ($(this).attr("checked")) {
-                $(this).removeAttr("checked");
-            } else {
-                $(this).attr("checked", "checked");
-            }
+            $(this).prop('checked', !$(this).is(':checked'));
         });
         return false;
     });
@@ -264,7 +260,8 @@
         if (helper_texts.length) {
             helper_texts.fadeOut();
         } else {
-            $(".moin-contenttypes-wrapper form").find(".helper-text").css("display", "block");
+            helper_texts = $(".moin-contenttypes-wrapper form").find(".helper-text");
+            helper_texts.fadeIn();
         }
 
         return false;
--- a/MoinMoin/themes/basic/templates/index.html	Sun Feb 09 23:48:41 2014 +0530
+++ b/MoinMoin/themes/basic/templates/index.html	Sun Feb 16 23:49:52 2014 +0530
@@ -220,7 +220,7 @@
 
 {% block body_scripts %}
 {{ super() }}
-    <script src="{{ url_for('frontend.template', filename='index_action.js') }}"></script>
+    <script src="{{ url_for('static', filename='js/index_action.js') }}"></script>
     <script src="{{ url_for('static', filename='js/jfu.js') }}"></script>
     {{ forms.file_uploader_scripts() }}
 {% endblock %}