Merge branch 'MDL-42835' of git://github.com/nobelium/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2014-06-10 00:36:33 +02:00
commit 0a87b6809f

View file

@ -60,25 +60,16 @@ M.mod_scorm.init = function(Y, nav_display, navposition_left, navposition_top, h
}; };
Y.TreeView.prototype.openAll = function () { Y.TreeView.prototype.openAll = function () {
var tree = this; this.get('container').all('.yui3-treeview-can-have-children').each(function(target) {
Y.all('.yui3-treeview-can-have-children').each(function() { this.getNodeById(target.get('id')).open();
var node = tree.getNodeById(this.get('id')); }, this);
node.open();
});
}; };
// TODO: Remove next(), previous() prototype functions after YUI has been updated to 3.11.0 - MDL-41208. Y.TreeView.prototype.closeAll = function () {
Y.Tree.Node.prototype.next = function () { this.get('container').all('.yui3-treeview-can-have-children').each(function(target) {
if (this.parent) { this.getNodeById(target.get('id')).close();
return this.parent.children[this.index() + 1]; }, this);
} }
};
Y.Tree.Node.prototype.previous = function () {
if (this.parent) {
return this.parent.children[this.index() - 1];
}
};
var scorm_parse_toc_tree = function(srcNode) { var scorm_parse_toc_tree = function(srcNode) {
var SELECTORS = { var SELECTORS = {
@ -141,6 +132,7 @@ M.mod_scorm.init = function(Y, nav_display, navposition_left, navposition_top, h
scorm_current_node.select(); scorm_current_node.select();
} }
scorm_tree_node.closeAll();
// remove any reference to the old API // remove any reference to the old API
if (window.API) { if (window.API) {
window.API = null; window.API = null;
@ -202,6 +194,7 @@ M.mod_scorm.init = function(Y, nav_display, navposition_left, navposition_top, h
} }
scorm_fixnav(); scorm_fixnav();
} }
scorm_tree_node.openAll();
}; };
mod_scorm_activate_item = scorm_activate_item; mod_scorm_activate_item = scorm_activate_item;