mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(slideBox): make it so elements are properly removed
This commit is contained in:
3
js/angular/controller/slideController.js
vendored
3
js/angular/controller/slideController.js
vendored
@@ -7,8 +7,7 @@ function(scope, element, $q) {
|
||||
var self = this;
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
element.removeData();
|
||||
detachSlide();
|
||||
attachSlide();
|
||||
});
|
||||
element.on(ionic.CSS.TRANSITIONEND, onTransitionEnd);
|
||||
|
||||
|
||||
6
js/angular/service/attachDrag.js
vendored
6
js/angular/service/attachDrag.js
vendored
@@ -20,9 +20,9 @@ IonicModule
|
||||
var dragEndGesture = ionic.onGesture('dragend', handleDragEnd, element[0]);
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
ionic.offGesture(dragStartGesture);
|
||||
ionic.offGesture(dragGesture);
|
||||
ionic.offGesture(dragEndGesture);
|
||||
ionic.offGesture(dragStartGesture, 'dragstart', handleDragStart);
|
||||
ionic.offGesture(dragGesture, 'drag', handleDrag);
|
||||
ionic.offGesture(dragEndGesture, 'dragend', handleDragEnd);
|
||||
});
|
||||
|
||||
var dragState;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<div ng-controller="SlideCtrl">
|
||||
<ion-content>
|
||||
<ion-slide-box selected="$root.selectedIndex" loop="true">
|
||||
<ion-slide-box selected="$root.selectedIndex" loop="true" ng-if="$root.hasBox">
|
||||
<ion-slide ng-controller="FirstSlideCtrl">
|
||||
<h3>Thank you for choosing the Awesome App!</h3>
|
||||
<div id="logo">
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
.controller('SlideCtrl', function($scope, $timeout) {
|
||||
$scope.items = [];
|
||||
for (var i = 0; i < 10; i++) {
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
$scope.items.push(i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user