Skip to content

Commit

Permalink
MDL-23751 fix the clearing down of the TOC before reloading the next …
Browse files Browse the repository at this point in the history
…after

navigation.
  • Loading branch information
piersharding committed Aug 13, 2010
1 parent f8af9d6 commit 07b5ee3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions mod/scorm/datamodels/callback.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
success: function(o) {
scorm_tree_node = YAHOO.widget.TreeView.getTree('scorm_tree');
if (o.responseText !== undefined) {
if (scorm_tree_node && o.responseText) {
var hnode = scorm_tree_node.getHighlightedNode();
var hidx = null;
if (hnode) {
hidx = hnode.index + scorm_tree_node.getNodeCount();
}
// all gone
var root_node = scorm_tree_node.getRoot();
scorm_tree_node.removeNode(root_node.children[0]);
if (scorm_tree_node && o.responseText) {
var hnode = scorm_tree_node.getHighlightedNode();
var hidx = null;
if (hnode) {
hidx = hnode.index + scorm_tree_node.getNodeCount();
}
// all gone
var root_node = scorm_tree_node.getRoot();
while (root_node.children.length > 0) {
scorm_tree_node.removeNode(root_node.children[0]);
}
}
// make sure the temporary tree element is not there
var el_old_tree = document.getElementById('scormtree123');
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/datamodels/scorm_12.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function LMSCommit (param) {
if (scorm_debugging($scorm)) {
//echo 'alert("Finished SCORM 1.2");';
echo 'LogAPICall("LMSCommit", "result", result, 0);';
echo 'LogAPICall("LMSCommit", param, "", 0);';
echo 'LogAPICall("LMSCommit", "errorCode", errorCode, 0);';
}
?>
return result;
Expand Down

0 comments on commit 07b5ee3

Please sign in to comment.