Skip to content

Commit 9237581

Browse files
authored
Merge pull request #296 from bjc-edc/css-tweaks
Fix #294 topic page mobile headings
2 parents d972517 + 753de4b commit 9237581

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

llab/script/topic.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ llab.renderFull = function renderAndParse(data) {
191191
};
192192

193193
llab.renderTopicModel = function rederer(topics) {
194+
console.log('Topics.title:', topics.title);
195+
console.log('Topics:', topics);
194196
llab.renderTitle(topics.title);
195197
topics.topics.forEach(function (topic) {
196198
llab.renderTopic(topic);
@@ -200,7 +202,7 @@ llab.renderTopicModel = function rederer(topics) {
200202
llab.renderTitle = function (title) {
201203
var navbar, titleText;
202204
navbar = $('.navbar-title');
203-
$(llab.selectors.MOBILETITLE).html(title);
205+
$('.title-small-screen').html(title);
204206
navbar.html(title);
205207
titleText = navbar.text(); // Normalize Window Title
206208
titleText = titleText.replace("snap", "Snap!");
@@ -216,12 +218,11 @@ llab.renderCourseLink = function (course) {
216218
if (course.indexOf("://") === -1) {
217219
course = llab.courses_path + course;
218220
}
221+
let courseLink = `<a class="course_link pull-right" href="${course}">${llab.t(llab.strings.goMain)}</a>`;
219222
if ($('.title-small-screen').length > 0) {
220-
$(`<a class="course_link pull-right" href="${course}">${llab.t(llab.strings.goMain)}</a>`).insertAfter('.title-small-screen');
223+
$(courseLink).insertAfter('.title-small-screen');
221224
} else {
222-
$(llab.selectors.FULL).prepend(
223-
`<a class="course_link pull-right" href="${course}">${llab.t(llab.strings.goMain)}</a>`
224-
);
225+
$(llab.selectors.FULL).prepend(courseLink);
225226
}
226227
};
227228

@@ -387,4 +388,4 @@ llab.displayTopic = function() {
387388
}
388389
};
389390

390-
$(document).ready(() => llab.displayTopic());
391+
$(llab.displayTopic);

0 commit comments

Comments
 (0)