Skip to content

Commit a0ee41d

Browse files
authored
Merge pull request #3418 from AngelFQC/3409
LP: Show item view when selecting an item in ToC #3409
2 parents 23d8c3b + 2c1b645 commit a0ee41d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

main/template/default/learnpath/view.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@
139139
</div>
140140
{# TOC layout #}
141141
<div id="toc_id" class="scorm-body" name="toc_name">
142+
{# div#flab-mobile is to know when the user is on mobile view. Don't delete. #}
143+
<div id="flag-mobile" class="visible-xs-block" aria-hidden="true"></div>
142144
{% include 'learnpath/scorm_list.tpl'|get_template %}
143145
</div>
144146
{# end TOC layout #}
@@ -299,6 +301,16 @@
299301
$('.lp-view-tabs').animate({opacity: 1}, 500);
300302
});
301303
304+
{% if lp_mode == 'embedded' %}
305+
$('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
306+
$('.lp-view-tabs').animate({opacity: 0}, 500);
307+
308+
if ($('#flag-mobile').is(':visible') && !$('#learning_path_main').is('.lp-view-collapsed')) {
309+
$('#lp-view-expand-toggle').trigger('click');
310+
}
311+
});
312+
{% endif %}
313+
302314
loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
303315
checkCurrentItemPosition({{ lp_current_item_id }});
304316

0 commit comments

Comments
 (0)