Skip to content

Commit 8ff028f

Browse files
author
Ron Lucke
committed
fix scrollytelling layout
1 parent 5c9bf1f commit 8ff028f

4 files changed

Lines changed: 24 additions & 15 deletions

File tree

blocks/Courseware/js/section_list.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export default Backbone.View.extend({
2828

2929
postRender() {
3030
tooltip(this.$el, 'li.prev,li.section,li.next', function () { return jQuery(this).find('a').attr('data-title') });
31-
this.makeSticky();
31+
if (!this.$el.hasClass('active-subchapter-nav-disabled')) {
32+
this.makeSticky();
33+
}
3234
},
3335

3436
makeSticky() {

blocks/Courseware/templates/active_subchapter.mustache

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="active-subchapter-nav-placeholder"></div>
22
<ol class="active-subchapter
3-
{{^show_section_nav}} active-subchapter-nav-disabled {{/show_section_nav}}
4-
{{#sections_as_chapters}} active-subchapter-nav-disabled {{/sections_as_chapters}}"
3+
{{^show_section_nav}} {{^scrollytelling}}active-subchapter-nav-disabled {{/scrollytelling}}{{/show_section_nav}}
4+
{{#sections_as_chapters}} {{^scrollytelling}} active-subchapter-nav-disabled {{/scrollytelling}} {{/sections_as_chapters}}"
55
data-blockid={{active_subchapter.id}}
66
data-type=Subchapter>
77

@@ -11,8 +11,7 @@
1111
</li>
1212
{{/scrollytelling}}
1313

14-
{{#show_section_nav}}
15-
{{^sections_as_chapters}}
14+
1615
{{#section_nav}}
1716
{{#prev}}
1817
<li class="prev">
@@ -32,15 +31,19 @@
3231
{{/prev}}
3332
{{/section_nav}}
3433

35-
{{#sections}}
36-
{{> section}}
37-
{{/sections}}
38-
{{^sections}}
39-
{{> section_empty}}
40-
{{/sections}}
34+
{{#show_section_nav}}
35+
{{^sections_as_chapters}}
4136

42-
<li class=no-content>{{#i18n}}Keine Abschnitte{{/i18n}}</li>
37+
{{#sections}}
38+
{{> section}}
39+
{{/sections}}
40+
{{^sections}}
41+
{{> section_empty}}
42+
{{/sections}}
4343

44+
<li class=no-content>{{#i18n}}Keine Abschnitte{{/i18n}}</li>
45+
{{/sections_as_chapters}}
46+
{{/show_section_nav}}
4447
{{#section_nav}}
4548
{{#next}}
4649
<li class="next">
@@ -60,6 +63,8 @@
6063
{{/next}}
6164
{{/section_nav}}
6265

66+
{{#show_section_nav}}
67+
{{^sections_as_chapters}}
6368
{{#user_can_edit_subchapter}}
6469
<li class=controls>
6570
<button class=add-section>{{#i18n}}Abschnitt einfügen{{/i18n}}</button>

blocks/Courseware/templates/edit_structure.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<button type="button" class="cancel">cancel</button>
55
{{#chapter}}
66
<br>
7-
<label for="publication_date">{{#i18n}}sichtbar ab:{{/i18n}}</label>
7+
<label for="publication_date">{{#i18n}}sichtbar ab{{/i18n}}:</label>
88
<input type="date" name="publication_date" value="{{publication_date}}">
99
<br>
10-
<label for="withdraw_date">{{#i18n}}unsichtbar ab:{{/i18n}}</label>
10+
<label for="withdraw_date">{{#i18n}}unsichtbar ab{{/i18n}}:</label>
1111
<input type="date" name="withdraw_date" value="{{withdraw_date}}">
1212
<br>
1313
<span class="date-info">{{#i18n}}Enddatum liegt vor Startdatum!{{/i18n}}</span>

blocks/ScrollyBlock/css/scrolly_block.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
section#courseware.scrollyware {
55

66
ol.active-subchapter.stuck {
7-
position: unset;
7+
border: solid thin #ccc;
8+
padding-left: 12px;
9+
left: 0 !important;
810
}
911

1012
section.block.HtmlBlock,

0 commit comments

Comments
 (0)