From 490e604bae0965b8118af4aa6ea0b2fce5a827ca Mon Sep 17 00:00:00 2001 From: Paul Nicholls Date: Fri, 14 Dec 2012 12:01:39 +1300 Subject: [PATCH] MDL-37162: Use CSS to make mod show/hide icons not look "clickable" in hidden sections Previously, the resource toolbox initialiser was using JS to find the show/hide icon, then find its section ancestor, then check if the section was hidden - only to pointlessly set pointer:auto if it was. That didn't meet the aim stated in the comments ("Disable" show/hide icons (change cursor to not look clickable) if section is hidden), but this patch meets that goal with a single CSS rule. --- course/yui/toolboxes/toolboxes.js | 15 --------------- theme/base/style/course.css | 3 +++ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/course/yui/toolboxes/toolboxes.js b/course/yui/toolboxes/toolboxes.js index 1b37f40a506..67c00010c5b 100644 --- a/course/yui/toolboxes/toolboxes.js +++ b/course/yui/toolboxes/toolboxes.js @@ -259,15 +259,6 @@ YUI.add('moodle-course-toolboxes', function(Y) { }, _setup_for_resource : function(toolboxtarget) { toolboxtarget = Y.one(toolboxtarget); - // "Disable" show/hide icons (change cursor to not look clickable) if section is hidden - var showhide = toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.HIDE); - showhide.concat(toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.SHOW)); - showhide.each(function(node) { - var section = node.ancestor(CSS.SECTIONLI); - if (section && section.hasClass(CSS.SECTIONHIDDENCLASS)) { - node.setStyle('cursor', 'auto'); - } - }); // Set groupmode attribute for use by this.toggle_groupmode() var groups; @@ -708,12 +699,6 @@ YUI.add('moodle-course-toolboxes', function(Y) { if (Y.Array.indexOf(response.resourcestotoggle, activityid) != -1) { this.toggle_hide_resource_ui(button); } - - if (value == 0) { - button.setStyle('cursor', 'auto'); - } else { - button.setStyle('cursor', 'pointer'); - } }, this); }, toggle_highlight : function(e) { diff --git a/theme/base/style/course.css b/theme/base/style/course.css index 072551c03b3..09a83856497 100644 --- a/theme/base/style/course.css +++ b/theme/base/style/course.css @@ -87,6 +87,9 @@ .dir-rtl.path-course-view .completionprogress {float: none;} .dir-rtl.path-course-view li.activity form.togglecompletion .ajaxworking {right: -22px;} +li.section.hidden span.commands a.editing_hide, +li.section.hidden span.commands a.editing_show {cursor:default;} + .section img.movetarget {height:16px;width:80px;} #page-course-enrol .generalbox,