-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial slidebox implementation. closes #5
- Loading branch information
Nick Wientge
committed
Feb 25, 2015
1 parent
a29f799
commit 1959ed7
Showing
8 changed files
with
2,333 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,5 @@ | ||
<template name="ionSlide"> | ||
<div class="{{classes}}"> | ||
{{> UI.contentBlock}} | ||
</div> | ||
</template> |
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,11 @@ | ||
Template.ionSlide.helpers({ | ||
classes: function () { | ||
var classes = ['ion-slide']; | ||
|
||
if (this.class) { | ||
classes.push(this.class); | ||
} | ||
|
||
return classes.join(' '); | ||
} | ||
}); |
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,5 @@ | ||
<template name="ionSlideBox"> | ||
<div class="ion-slide-box"> | ||
{{> UI.contentBlock}} | ||
</div> | ||
</template> |
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,29 @@ | ||
Template.ionSlideBox.created = function () { | ||
this.data = this.data || {}; | ||
this.doesContinue = this.data.doesContinue || false; | ||
this.autoPlay = this.data.autoPlay || false; | ||
this.slideInterval = this.data.slideInterval || 4000; | ||
this.showPager = typeof this.data.showPager != 'undefined' ? this.data.showPager : true; | ||
}; | ||
|
||
Template.ionSlideBox.rendered = function () { | ||
this.$('.ion-slide-box').slick({ | ||
infinite: this.doesContinue, | ||
autoplay: this.autoPlay, | ||
autoplaySpeed: this.slideInterval, | ||
arrows: false, | ||
dots: this.showPager, | ||
dotsClass: 'slider-pager', | ||
customPaging: function(slider, i) { | ||
return '<span class="slider-pager-page icon ion-record"></span>'; | ||
} | ||
}); | ||
|
||
this.$('.ion-slide-box').on('afterChange', function (event, slick, currentSlide) { | ||
$(this).trigger({type: 'onSlideChanged', index: currentSlide}); | ||
}); | ||
}; | ||
|
||
Template.ionSlideBox.destroyed = function () { | ||
this.$('.ion-slide-box').unslick(); | ||
}; |
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,125 @@ | ||
/* Slider */ | ||
.slick-slider | ||
{ | ||
position: relative; | ||
height: 100%; | ||
display: block; | ||
|
||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
|
||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
|
||
-webkit-touch-callout: none; | ||
-khtml-user-select: none; | ||
-ms-touch-action: pan-y; | ||
touch-action: pan-y; | ||
-webkit-tap-highlight-color: transparent; | ||
} | ||
|
||
.slick-list | ||
{ | ||
position: relative; | ||
height: 100%; | ||
display: block; | ||
overflow: hidden; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
.slick-list:focus | ||
{ | ||
outline: none; | ||
} | ||
.slick-list.dragging | ||
{ | ||
cursor: pointer; | ||
cursor: hand; | ||
} | ||
|
||
.slick-slider .slick-track, | ||
.slick-slider .slick-list | ||
{ | ||
-webkit-transform: translate3d(0, 0, 0); | ||
-moz-transform: translate3d(0, 0, 0); | ||
-ms-transform: translate3d(0, 0, 0); | ||
-o-transform: translate3d(0, 0, 0); | ||
transform: translate3d(0, 0, 0); | ||
} | ||
|
||
.slick-track | ||
{ | ||
position: relative; | ||
top: 0; | ||
left: 0; | ||
|
||
display: block; | ||
|
||
height: 100%; | ||
} | ||
.slick-track:before, | ||
.slick-track:after | ||
{ | ||
display: table; | ||
|
||
content: ''; | ||
} | ||
.slick-track:after | ||
{ | ||
clear: both; | ||
} | ||
.slick-loading .slick-track | ||
{ | ||
visibility: hidden; | ||
} | ||
|
||
.slick-slide | ||
{ | ||
display: none; | ||
float: left; | ||
|
||
height: 100%; | ||
min-height: 1px; | ||
} | ||
[dir='rtl'] .slick-slide | ||
{ | ||
float: right; | ||
} | ||
.slick-slide img | ||
{ | ||
display: block; | ||
} | ||
.slick-slide.slick-loading img | ||
{ | ||
display: none; | ||
} | ||
.slick-slide.dragging img | ||
{ | ||
pointer-events: none; | ||
} | ||
.slick-initialized .slick-slide | ||
{ | ||
display: block; | ||
} | ||
.slick-loading .slick-slide | ||
{ | ||
visibility: hidden; | ||
} | ||
.slick-vertical .slick-slide | ||
{ | ||
display: block; | ||
|
||
height: auto; | ||
|
||
border: 1px solid transparent; | ||
} | ||
|
||
/*Meteoric hack:*/ | ||
.slider-pager li { | ||
display: inline; | ||
} | ||
.slider-pager .slick-active .slider-pager-page { | ||
opacity: 1; | ||
} |
Oops, something went wrong.