Slidebox Refactor landed in nightly with huge API changes


#66

@andy Hi,
Am I Missing something here?
I had a fully working markup with slide-box inside ion-list where each slide could be clicked to reveal more info and the height was dynamic to what was ng-showing. Tried out the nightly for the better performance and to loose the android not-scrolling on slide-box bug. Now nothing works. The ion-list is in a fixed height and the slider takes up the full width and height of the item, hiding my header that I have on each item in the list. I need dynamic height on both the list-item and the slides in the slide-box. How should I fix this?

Here is a plunker hopefully showing the problem

Thanks in advance


#67

usefull

no need of <div ng-if="$index >= (currentIndex-1) && $index <= (currentIndex+1)"> ?

if for someone helps i needed to get rid of overflow-scroll in ion-content for it to work.

thanks again


#68

adding this style help in some way for smoother transitions? <ion-slide-box loop="false" auto-play="false" style="-webkit-transform: translate3d(0, 0, 0);-webkit-overflow-scrolling: touch;"


#69

Loving these new updates, feels a lot more responsive now and fixes my issues with Android being over responsive when scrolling within a slide.

One thing I would really like is the ability to use a slide-box within a slide-box, as I have this as a feature request on the current app I’m building. Can we somehow prevent the event propagating up to the parent slide-box? Is this feature on the horizon?

EDIT: One bug I did find is when setting the selected slide on Android I was sometimes getting blank slides and still needed to do a .

$timeout(function(){
    $ionicSlideBoxDelegate.update();
  },50);

get the slide to load.


#70

Also, it seems the drag events have changed so now trying to unbind the scroll-box swipe for swiping events on elements within a slide now longer works. This codepen for exmaple is now broken within the new nightly

Any ideas how we can do something like this now…

$scope.letDrag = function() {
    console.log('letDrag');
    $ionicSlideBoxDelegate.enableSlide(true);
  };

  $scope.stopDrag = function() {
    console.log('stopDrag');
    $ionicSlideBoxDelegate.enableSlide(false);
  };

<div class="card" ng-controller="swipeCtrl" 
              on-touch="stopDrag()" 
              on-release="letDrag()">

#71

@olliekav can you try it with the latest nightly?

Everyone, can you try appending/prepending slides again? Everything will work as intended now if you have an ngRepeat and change the order of things.


#72

@andy That didn’t change anything for me, I still can’t find those events to unbind the slidebox. Is ontouch/onrelease the right approach? Or should I be checking for drag/swipe events?

It also broke my activeSlide implementation. I’m jumping to a particular slide from clicking a news entry on the homepage.

selected="activeSlide"

$scope.activeSlide = PostsData.slideIndex;

That now jumps to the wrong slide (the index before the correct slide) even though my console is showing the right active slide index being passed to the controller. I’ve had to roll it back to ‘1.0.0-beta.13-nightly-627’


#73

The drag events: I think I know the problem.

The wrong slide: Interesting. Could you post an example to plunkr?


#74

@andy

It’s a clients app so I’ll need to try and work up an example for plunker. Let me see what I can do.

I’m pretty sure it’s related to $iconicSlideBoxDelegate.update(); being removed now. As I had to take out those lines due to get getting JavaScript errors with that new nightly. Then the active slides stopped working properly.

Quick edit. I’ve just been playing around hardcoding the activeSlide value and it still picks the wrong slide. e.g.

$scope.activeSlide = 1; picks 0
$scope.activeSlide = 2; picks 1

and so, very odd. This is in he new nightly. Let me try and plunker with some clean code.

Code edit

Okay, I ripped everything out for a plunker to prove to myself I wasn’t going mad. As you can see in the following example the slides seem to be counting from 1 rather than 0 as they were before. Is that intentional?


#75

Any news on this @andy? Blocked from updating to any new nightlies at the moment.


#76

@andy : I think there’s a regression in slide-box for the height. It takes 100% of the entire view - not the parent element.

Issue # 2609 : https://github.com/driftyco/ionic/issues/2609

Sample : http://codepen.io/calendee/pen/zxGzKV


#77

Is this refactor in current release, 1.0.0-rc2? In the commit it mentions that for example update() method is removed, but it is present in both current docs and in the nightly docs.