Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3141 — stop calling baguetteBox.run twice #3152

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Bugfixes

* Enforce trailing slash for directories in ``nikola auto``
(Issue #3140)
* Galleries with baguetteBox don’t glitch out on the first image
anymore (Issue #3141)

Removed features
----------------
Expand Down
4 changes: 0 additions & 4 deletions nikola/data/themes/base/assets/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ function renderGallery(jsonContent, thumbnailSize) {
div.appendChild(link);
container.appendChild(div);
}
baguetteBox.run('#gallery_container', {
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
}

2 changes: 1 addition & 1 deletion nikola/data/themes/base/assets/js/gallery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions nikola/data/themes/bootblog4-jinja/templates/base.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@
<!-- end fancy dates -->
{% block extra_js %}{% endblock %}
<script>
baguetteBox.run('a.reference:not(.islink)', {
baguetteBox.run('div#content', {
ignoreClass: 'islink',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
{{ body_end }}
{{ template_hooks['body_end']() }}
Expand Down
7 changes: 2 additions & 5 deletions nikola/data/themes/bootblog4/templates/base.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@ ${base.late_load_js()}
<!-- end fancy dates -->
<%block name="extra_js"></%block>
<script>
baguetteBox.run('a.reference:not(.islink)', {
baguetteBox.run('div#content', {
ignoreClass: 'islink',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
${body_end}
${template_hooks['body_end']()}
Expand Down