Merge branch 'MDL-41227_dd' of https://github.com/andyjdavis/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 30 Sep 2013 03:15:53 +0000 (16:15 +1300)
committerSam Hemelryk <sam@moodle.com>
Mon, 30 Sep 2013 03:15:53 +0000 (16:15 +1300)
Conflicts:
course/yui/toolboxes/toolboxes.js

1  2 
course/yui/toolboxes/toolboxes.js

@@@ -445,14 -477,14 +445,14 @@@ YUI.add('moodle-course-toolboxes', func
              // Update button info.
              button.one('img').setAttrs({
                  'alt' : newstring,
-                 'src'   : M.util.image_url('t/' + newstatus)
+                 'src'   : M.util.image_url('t/' + nextaction)
              });
              button.set('title', newstring);
-             button.replaceClass('editing_'+status, 'editing_'+newstatus)
-             button.setData('action', newstatus);
+             button.replaceClass('editing_'+action, 'editing_'+nextaction);
+             button.setData('action', nextaction);
  
              // If activity is conditionally hidden, then don't toggle.
 -            if (this.get_instance_name(activity) == null) {
 +            if (Y.Moodle.core_course.util.cm.getName(activity) == null) {
                  toggleclass = CSS.DIMMEDTEXT;
                  dimarea = activity.all(SELECTOR.MODINDENTDIV + ' > div').item(1);
              }
                  } else {
                      var button = node.one(SELECTOR.HIDE);
                  }
 -                var activityid = this.get_element_id(node);
 +                var activityid = Y.Moodle.core_course.util.cm.getId(node);
  
 -                if (Y.Array.indexOf(response.resourcestotoggle, activityid) != -1) {
 +                // NOTE: resourcestotoggle is returned as a string instead
 +                // of a Number so we must cast our activityid to a String.
 +                if (Y.Array.indexOf(response.resourcestotoggle, "" + activityid) != -1) {
-                     node.getData('toolbox').handle_resource_dim(button, node, oldstatus);
+                     node.getData('toolbox').handle_resource_dim(button, node, action);
                  }
              }, this);
          },