Skip to content
Snippets Groups Projects
Commit 3bebf848 authored by srosse's avatar srosse
Browse files

OO-321: only show 1 button group next/previous if there isn't any scorm content to show

parent 4fdab065
No related branches found
No related tags found
No related merge requests found
......@@ -560,6 +560,16 @@ public class VelocityRenderDecorator {
Component source = renderer.findComponent(componentName);
return (source != null);
}
/**
* @param componentName
* @return true if the component with name componentName is a child of the current container and if this
* component is visible
*/
public boolean visible(String componentName) {
Component source = renderer.findComponent(componentName);
return (source != null && source.isVisible());
}
/**
* returns an object from the context of velocity
......
......@@ -96,7 +96,9 @@ public class OLATApiAdapter extends LogDelegator implements ch.ethz.pfplms.scorm
}
public void addAPIListener(ScormAPICallback apiCallback) {
apiCallbacks.add(apiCallback);
if(apiCallback != null) {
apiCallbacks.add(apiCallback);
}
}
/**
......
......@@ -319,6 +319,7 @@ public class ScormAPIandDisplayController extends MainLayoutBasicController {
if (te.getCommand().equals(MenuTree.COMMAND_TREENODE_EXPANDED)) {
iframectr.getInitialComponent().setVisible(false);
myContent.setDirty(true);//update the view
} else {
iframectr.getInitialComponent().setVisible(true);
String scormId = String.valueOf(treeModel.lookupScormNodeId(tn));
......
......@@ -18,7 +18,7 @@
//todo:gs:c On some sco's the first attempt to call the RTE fails, sending a dummy call is a workaroud for this
passApiCall("initcall","empty","empty");
</script>
#if($showNavButtons)
<div class="o_scorm_navigation" >
$r.render("previousScoTop")
......@@ -28,7 +28,7 @@
<div class="o_scorm_content">
$r.render("contentpackage")
</div>
#if($showNavButtons)
#if($showNavButtons && $r.visible("contentpackage"))
<div class="o_scorm_navigation" >
$r.render("previousScoBottom")
$r.render("nextScoBottom")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment