Skip to content

Commit 6a87077

Browse files
committed
UI work for gallery page per #64
1 parent d3c020d commit 6a87077

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

css/main.scss

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,28 +540,36 @@ div#displayEditor {
540540

541541
/* Gallery */
542542

543+
#galleryContainer {
544+
min-height: 100%;
545+
position: relative;
546+
}
547+
543548
#galleryView {
544549
margin: 12px auto 0 auto;
545550
}
546551

547552
.galleryImage {
548553
float: left;
549-
width: 240px;
550-
height: 192px;
554+
width: 250px;
555+
height: 200px;
551556
margin-bottom: 12px;
552557
}
553558

554559
#galleryControls {
555560
width: 100%;
556561
text-align: center;
557-
margin-bottom: 12px;
562+
padding-bottom: 28px;
558563
}
559564

560565
#galleryFooter {
561-
clear: both;
562-
text-align: center;
563566
width: 100%;
567+
height: 20px;
564568
color: #fff;
569+
position: absolute;
570+
bottom: 0;
571+
left: 0;
572+
text-align: center;
565573
}
566574

567575
/* Hints Preview */

gallery/index.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,31 @@
44
class: gallery
55
---
66

7-
{% include header.html %}
8-
97
<script id="template" type="text/html">
108
{% raw %}
119
<div class="galleryImage">
12-
<a href="{{link}}"><img src="{{image}}" width="240" height="192"/></a>
10+
<a href="{{link}}"><img src="{{image}}" width="250" height="200"/></a>
1311
</div>
1412
{% endraw %}
1513
</script>
1614

17-
<div id="galleryView">
15+
<div id="galleryContainer">
1816

17+
{% include header.html %}
1918

20-
</div>
19+
<div id="galleryView"></div>
2120

22-
<div id="galleryControls">
23-
<button id="loadMore" class="btn btn-default">Load More</button>
24-
</div>
21+
<div id="galleryControls">
22+
<button id="loadMore" class="btn btn-default" data-loading-text="Loading...">
23+
<span class="glyphicon glyphicon-plus"></span> Load More
24+
</button>
25+
</div>
2526

26-
<footer id="galleryFooter">
27-
Processing Hour of Code // Computer Science Education Week // Code.org
28-
</footer>
27+
<footer id="galleryFooter">
28+
Processing Hour of Code // Computer Science Education Week // Code.org
29+
</footer>
30+
31+
</div>
2932

3033
<script src="//www.parsecdn.com/js/parse-1.3.1.min.js"></script>
3134
<script src="/js/vendor/mustache.min.js" type="text/javascript"></script>

js/gallery.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var helloGallery = {
3636
query.count({
3737
success: function(number) {
3838
helloGallery.totalItems = number;
39-
console.log(helloGallery.totalItems);
4039
},
4140
error: function(error) {
4241
// error is an instance of Parse.Error.
@@ -63,6 +62,8 @@ var helloGallery = {
6362

6463
loadElements: function (callback) {
6564

65+
$("#loadMore").button('loading');
66+
6667
var GalleryObject = Parse.Object.extend("Gallery");
6768
var query = new Parse.Query(GalleryObject);
6869
query.limit(helloGallery.itemsPerPage);
@@ -94,7 +95,7 @@ var helloGallery = {
9495

9596
helloGallery.pageNumber++;
9697

97-
console.log(helloGallery.pageNumber * helloGallery.itemsPerPage);
98+
$("#loadMore").button('reset');
9899

99100
if (helloGallery.totalItems != null && helloGallery.pageNumber * helloGallery.itemsPerPage >= helloGallery.totalItems) {
100101
$("#loadMore").hide();

0 commit comments

Comments
 (0)