Commits

Luke Plant committed b23413b

Eliminated jumping to top of page when clicking collapse/add/remove buttons on dashboard modules

Comments (0)

Files changed (1)

admin_tools/dashboard/static/admin_tools/js/jquery/jquery.dashboard.js

 
     var _set_collapsible = function(elt, options) {
         elt.find('> .dashboard-column > .collapsible > h2').each(function() {
-            $(this).append('<a href="#" class="toggle-icon">Toggle</a>').find('a.toggle-icon').click(function() {
+            $(this).append('<a href="#" class="toggle-icon">Toggle</a>').find('a.toggle-icon').click(function(ev) {
+                ev.preventDefault();
                 var prnt = $(this).parent().parent();
                 _toggle_element(prnt, options, true);
             });
 
     var _set_deletable = function(elt, options) {
         elt.find('> .dashboard-column > .deletable > h2').each(function() {
-            $(this).append('<a href="#" class="close-icon">Close</a>').find('a.close-icon').click(function() {
+            $(this).append('<a href="#" class="close-icon">Close</a>').find('a.close-icon').click(function(ev) {
+                ev.preventDefault();
                 var prnt = $(this).parent().parent();
                 _delete_element(prnt, options, true);
             });
         if (!elts) {
             elts = $('#'+options.panel_id).find('li a');
         }
-        elts.click(function() {
+        elts.click(function(ev) {
+            ev.preventDefault();
             _add_element($('#'+$(this).attr('rel')), options, true);
         });
     };