Merge lp:~zematynnad/ubuntu-webcatalog/fix_no_enlarger_845911 into lp:ubuntu-webcatalog
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Łukasz Czyżykowski | ||||
Approved revision: | 126 | ||||
Merged at revision: | 130 | ||||
Proposed branch: | lp:~zematynnad/ubuntu-webcatalog/fix_no_enlarger_845911 | ||||
Merge into: | lp:ubuntu-webcatalog | ||||
Diff against target: |
148 lines (+53/-61) 2 files modified
src/webcatalog/static/js/screenshots.js (+53/-60) src/webcatalog/templates/webcatalog/screenshot_widget.html (+0/-1) |
||||
To merge this branch: | bzr merge lp:~zematynnad/ubuntu-webcatalog/fix_no_enlarger_845911 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Canonical Consumer Applications Hackers | Pending | ||
Review via email: mp+107848@code.launchpad.net |
Commit message
Fix for javascript errors after ajax returns more screenshots for app.
Description of the change
Overview
========
This branch fixes a condition where the screenshot enlarger was not being displayed when screenshots were obtained via ajax.
Details
========
Because the number of screenshots was critical to much of the logic in the screenshots.js page the ajax portion of it was causing some issues when it changed the number of screenshots. For example the setup_carouse function was only defined if there was originally more than one screenshot. So, when via ajax we now had more screenshots the function to set up the carousel was not defined.
So now what the script does is settle at the outset the number of screenshots (via ajax or not) so that the number change happens before any logic that depends on that number.
I also removed a small line of debug code in the html page.
To Run the Tests
=========
$fab bootstrap test
To View the Different Scenarios in the Browser
=======
0 screenshots: http://
1 screenshot: http://
1 screenshot after ajax: http://
2 or more screenshots: http://