This repository has been archived by the owner on Jun 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #837 from kawazrepos/834
画像のモーダルが記事中の全ての画像に適応されるようになった closes #834
- Loading branch information
Showing
4 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$ -> | ||
$imgs = $('.markdown img') | ||
$imgs.each((index) -> | ||
src = $(@).attr('src') | ||
$existingWrapper = $(@).closest('a[data-lightbox]') | ||
unless $existingWrapper.size() | ||
$wrapper = $('<a>').attr('data-lightbox', 'article') | ||
$wrapper.attr('href', src) | ||
$(@).wrap($wrapper) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<a href="{{ material.content_file.url }}" rel="lightbox" data-lightbox="screenshots"> | ||
<a href="{{ material.content_file.url }}" data-lightbox="article"> | ||
<img src="{{ material.content_file.url }}" alt="{{ material.filename }}" style="max-width: 500px;" /> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters