Skip to content
Permalink
Browse files

fix #10 - better add slide handling

  • Loading branch information...
corentin-gautier committed Dec 7, 2016
1 parent b6f5247 commit 17ea1ec25c342113e3f29fb44e4c1ecdf2d4c3ff
@@ -141,8 +141,9 @@

/////////////////////////

setElements();

function init() {
setElements();
setOptions();
setWatchers();

@@ -530,10 +531,11 @@
vm.slides[index] = slide;
} else {
vm.slides.splice(index, 0, slide);
}

if (vm.ready) {
setOptions();
setSlidesDimensions(index);
$timeout(function() {
move(vm.currentIndex, null, true);
}, 150);
}
}

@@ -701,7 +703,7 @@
*/
function move(forward, userMove, replace) {

if (vm.options.beforeSlide) {
if (vm.options && vm.options.beforeSlide) {
vm.options.beforeSlide()();
}

Large diffs are not rendered by default.

@@ -140,8 +140,9 @@

/////////////////////////

setElements();

function init() {
setElements();
setOptions();
setWatchers();

@@ -529,10 +530,11 @@
vm.slides[index] = slide;
} else {
vm.slides.splice(index, 0, slide);
}

if (vm.ready) {
setOptions();
setSlidesDimensions(index);
$timeout(function() {
move(vm.currentIndex, null, true);
}, 150);
}
}

@@ -700,7 +702,7 @@
*/
function move(forward, userMove, replace) {

if (vm.options.beforeSlide) {
if (vm.options && vm.options.beforeSlide) {
vm.options.beforeSlide()();
}

@@ -66,6 +66,7 @@ $pager-items-hover-scale: 1.4;
float: none;
white-space: normal;
text-align: left;

img {
pointer-events: none
}
@@ -128,10 +128,10 @@
alwaysFill: true,

beforeSlide: function () {
$log.log('before slide callback');
// $log.info('before slide callback');
},
afterSlide: function () {
$log.log('after slide callback');
$log.info('after slide callback');
}

};
@@ -167,7 +167,7 @@
<div
kaarousel-slide
ng-if="!$first || ($first && !main.hideFirst)"
ng-repeat="slide in ::main.data | orderBy:'rank' track by $index">
ng-repeat="slide in main.data | orderBy:'rank' track by $index">
<!-- Slide content -->
<md-card class="thumbnail">
<md-toolbar>
@@ -218,9 +218,6 @@ <h3>{{slide.title}}</h3>
&nbsp;&nbsp;&nbsp;&nbsp;after-slide="function"<br >
&gt;
</code>
<div layout="row" layout-align="end center">
<md-button class="md-primary md-raised" ng-click="main.hideFirstSlide()">Hide first slide</md-button>
</div>
</div>

</md-content>
@@ -14,26 +14,19 @@ body {
background: #E82C2C;
}
}
&.visible {
md-card {
// outline:1px solid #FFB400;
// box-shadow: 0px 5px 22px rgba(0, 0, 0, .14);
}
}
}
}
}
kaarousel.direction-horizontal, [kaarousel].direction-horizontal {
kaarousel-slider {
.kaarousel-slide {
vertical-align: middle;

vertical-align: top;
}
}
}
kaarousel.direction-vertical, [kaarousel].direction-vertical {
width: 250px;
height: 400px;
height: 600px;

kaarousel-slider .kaarousel-slide, kaarousel-slider .kaarousel-slide {
overflow: hidden;

0 comments on commit 17ea1ec

Please sign in to comment.
You can’t perform that action at this time.