From 751501686053eb87a8a24dc1a7cd3b019ba451d0 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Tue, 27 Oct 2015 11:18:56 +0000 Subject: [PATCH] Remove href on collapse-link when JS is disabled When JS is disabled, the collapsible section is always shown open; the '+' icon is therefore useless, and it does not make sense to turn it into a hyperlink. The href attribute has been removed (the existing javascript handles adding the hyperlink when enabled), and the cursor is set to 'pointer' via javascript. --- core/collapse_api.php | 2 +- javascript/common.js | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/core/collapse_api.php b/core/collapse_api.php index 05e1572936..bb855d1954 100644 --- a/core/collapse_api.php +++ b/core/collapse_api.php @@ -134,7 +134,7 @@ function collapse_icon( $p_name, $p_section = '' ) { $t_id = $p_name. '_closed_link'; } - echo '', $t_alt, ' '; + echo '', $t_alt, ' '; } /** diff --git a/javascript/common.js b/javascript/common.js index 34c1f914aa..0632db64c2 100644 --- a/javascript/common.js +++ b/javascript/common.js @@ -37,16 +37,18 @@ style_display = 'block'; $(document).ready( function() { $('.collapse-open').show(); $('.collapse-closed').hide(); - $('.collapse-link').click( function(event) { - event.preventDefault(); - var id = $(this).attr('id'); - var t_pos = id.indexOf('_closed_link' ); - if( t_pos == -1 ) { - t_pos = id.indexOf('_open_link' ); - } - var t_div = id.substring(0, t_pos ); - ToggleDiv( t_div ); - }); + $('.collapse-link') + .css('cursor', 'pointer') + .click( function(event) { + event.preventDefault(); + var id = $(this).attr('id'); + var t_pos = id.indexOf('_closed_link' ); + if( t_pos == -1 ) { + t_pos = id.indexOf('_open_link' ); + } + var t_div = id.substring(0, t_pos ); + ToggleDiv( t_div ); + }); $('input[type=text].autocomplete').autocomplete({ source: function(request, callback) {