Skip to content

Commit

Permalink
Fix next/prev buttons when nitf id is not a good css selector
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Feb 11, 2017
1 parent 0808e73 commit e07c55f
Show file tree
Hide file tree
Showing 14 changed files with 266 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -6,6 +6,10 @@ There's a frood who really knows where his towel is.
2.0b5 (unreleased)
^^^^^^^^^^^^^^^^^^

- Simplify slideshow template to avoid depending on context id;
this solves an issue when id ends with ".html".
[rodfersou]

- Refactor static resources.
[rodfersou]

Expand Down
3 changes: 0 additions & 3 deletions src/collective/nitf/browser/__init__.py
Expand Up @@ -42,9 +42,6 @@ class Slideshow(DefaultView):

"""Slideshow view of a News Article."""

def id(self):
return id(self)

def js_resources(self):
"""Return a list of JS resources that are not available in the
registry, but need to be loaded anyway. This way the slideshow
Expand Down
10 changes: 5 additions & 5 deletions src/collective/nitf/browser/templates/slideshow.pt
@@ -1,7 +1,7 @@
<div class="slideshow-container"
<div id="nitf-slideshow"
class="slideshow-container"
tal:define="images context/get_images"
tal:condition="images"
tal:attributes="id string:photogallery-${context/id}">
tal:condition="images">
<div class="slideshow-player">
<div class="cycle-player cycle-slideshow"
data-cycle-slides="> div"
Expand All @@ -10,8 +10,8 @@
data-allow-wrap="true"
data-cycle-fx="fade"
data-cycle-log="false"
tal:attributes="data-cycle-prev string:#photogallery-${context/id} .cycle-prev;
data-cycle-next string:#photogallery-${context/id} .cycle-next">
data-cycle-prev="#nitf-slideshow .cycle-prev"
data-cycle-next="#nitf-slideshow .cycle-next">
<div tal:repeat="image images">
<img tal:replace="structure image/@@images/image/large" />
</div>
Expand Down
Binary file removed src/collective/nitf/static/images/next-arrow.png
Binary file not shown.
Binary file removed src/collective/nitf/static/images/prev-arrow.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/collective/nitf/static/nitf.css

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

0 comments on commit e07c55f

Please sign in to comment.