mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Starting to move over to content directive
This commit is contained in:
15
dist/js/ionic-angular.js
vendored
15
dist/js/ionic-angular.js
vendored
@@ -679,7 +679,7 @@ angular.module('ionic.ui.content', [])
|
||||
if(attr.refreshComplete) {
|
||||
$scope.refreshComplete = function() {
|
||||
if($scope.scrollView) {
|
||||
$scope.scrollView.doneRefreshing();
|
||||
//$scope.scrollView.doneRefreshing();
|
||||
$scope.$parent.$broadcast('scroll.onRefreshComplete');
|
||||
}
|
||||
};
|
||||
@@ -702,17 +702,8 @@ angular.module('ionic.ui.content', [])
|
||||
}
|
||||
$element.append(sc);
|
||||
// Otherwise, supercharge this baby!
|
||||
sv = new ionic.views.Scroll({
|
||||
el: $element[0].firstElementChild,
|
||||
hasPullToRefresh: (typeof $scope.onRefresh !== 'undefined'),
|
||||
onRefresh: function() {
|
||||
$scope.onRefresh();
|
||||
$scope.$parent.$broadcast('scroll.onRefresh');
|
||||
},
|
||||
onRefreshOpening: function(amt) {
|
||||
$scope.onRefreshOpening({amount: amt});
|
||||
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
|
||||
}
|
||||
sv = new ionic.views.Scroller({
|
||||
el: $element[0]
|
||||
});
|
||||
// Let child scopes access this
|
||||
$scope.scrollView = sv;
|
||||
|
||||
23
dist/js/ionic.js
vendored
23
dist/js/ionic.js
vendored
@@ -3118,14 +3118,14 @@ var Scroller;
|
||||
ionic.views.Scroller = ionic.views.View.inherit({
|
||||
initialize: function(options) {
|
||||
|
||||
this.__container = options.content;
|
||||
this.__content = options.content.firstElementChild;
|
||||
this.__container = options.el;
|
||||
this.__content = options.el.firstElementChild;
|
||||
|
||||
|
||||
this.options = {
|
||||
|
||||
/** Enable scrolling on x-axis */
|
||||
scrollingX: true,
|
||||
/** Disable scrolling on x-axis by default */
|
||||
scrollingX: false,
|
||||
|
||||
/** Enable scrolling on y-axis */
|
||||
scrollingY: true,
|
||||
@@ -3344,7 +3344,10 @@ var Scroller;
|
||||
|
||||
|
||||
__initEventHandlers: function() {
|
||||
var self = this;
|
||||
|
||||
// Event Handler
|
||||
var container = this.__container;
|
||||
|
||||
if ('ontouchstart' in window) {
|
||||
|
||||
@@ -3354,16 +3357,16 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchStart(e.touches, e.timeStamp);
|
||||
self.doTouchStart(e.touches, e.timeStamp);
|
||||
e.preventDefault();
|
||||
}, false);
|
||||
|
||||
document.addEventListener("touchmove", function(e) {
|
||||
scroller.doTouchMove(e.touches, e.timeStamp);
|
||||
self.doTouchMove(e.touches, e.timeStamp);
|
||||
}, false);
|
||||
|
||||
document.addEventListener("touchend", function(e) {
|
||||
scroller.doTouchEnd(e.timeStamp);
|
||||
self.doTouchEnd(e.timeStamp);
|
||||
}, false);
|
||||
|
||||
} else {
|
||||
@@ -3376,7 +3379,7 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchStart([{
|
||||
self.doTouchStart([{
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY
|
||||
}], e.timeStamp);
|
||||
@@ -3389,7 +3392,7 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchMove([{
|
||||
self.doTouchMove([{
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY
|
||||
}], e.timeStamp);
|
||||
@@ -3402,7 +3405,7 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchEnd(e.timeStamp);
|
||||
self.doTouchEnd(e.timeStamp);
|
||||
|
||||
mousedown = false;
|
||||
}, false);
|
||||
|
||||
15
js/ext/angular/src/directive/ionicContent.js
vendored
15
js/ext/angular/src/directive/ionicContent.js
vendored
@@ -55,7 +55,7 @@ angular.module('ionic.ui.content', [])
|
||||
if(attr.refreshComplete) {
|
||||
$scope.refreshComplete = function() {
|
||||
if($scope.scrollView) {
|
||||
$scope.scrollView.doneRefreshing();
|
||||
//$scope.scrollView.doneRefreshing();
|
||||
$scope.$parent.$broadcast('scroll.onRefreshComplete');
|
||||
}
|
||||
};
|
||||
@@ -78,17 +78,8 @@ angular.module('ionic.ui.content', [])
|
||||
}
|
||||
$element.append(sc);
|
||||
// Otherwise, supercharge this baby!
|
||||
sv = new ionic.views.Scroll({
|
||||
el: $element[0].firstElementChild,
|
||||
hasPullToRefresh: (typeof $scope.onRefresh !== 'undefined'),
|
||||
onRefresh: function() {
|
||||
$scope.onRefresh();
|
||||
$scope.$parent.$broadcast('scroll.onRefresh');
|
||||
},
|
||||
onRefreshOpening: function(amt) {
|
||||
$scope.onRefreshOpening({amount: amt});
|
||||
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
|
||||
}
|
||||
sv = new ionic.views.Scroller({
|
||||
el: $element[0]
|
||||
});
|
||||
// Let child scopes access this
|
||||
$scope.scrollView = sv;
|
||||
|
||||
@@ -284,14 +284,14 @@ var Scroller;
|
||||
ionic.views.Scroller = ionic.views.View.inherit({
|
||||
initialize: function(options) {
|
||||
|
||||
this.__container = options.content;
|
||||
this.__content = options.content.firstElementChild;
|
||||
this.__container = options.el;
|
||||
this.__content = options.el.firstElementChild;
|
||||
|
||||
|
||||
this.options = {
|
||||
|
||||
/** Enable scrolling on x-axis */
|
||||
scrollingX: true,
|
||||
/** Disable scrolling on x-axis by default */
|
||||
scrollingX: false,
|
||||
|
||||
/** Enable scrolling on y-axis */
|
||||
scrollingY: true,
|
||||
@@ -510,7 +510,10 @@ var Scroller;
|
||||
|
||||
|
||||
__initEventHandlers: function() {
|
||||
var self = this;
|
||||
|
||||
// Event Handler
|
||||
var container = this.__container;
|
||||
|
||||
if ('ontouchstart' in window) {
|
||||
|
||||
@@ -520,16 +523,16 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchStart(e.touches, e.timeStamp);
|
||||
self.doTouchStart(e.touches, e.timeStamp);
|
||||
e.preventDefault();
|
||||
}, false);
|
||||
|
||||
document.addEventListener("touchmove", function(e) {
|
||||
scroller.doTouchMove(e.touches, e.timeStamp);
|
||||
self.doTouchMove(e.touches, e.timeStamp);
|
||||
}, false);
|
||||
|
||||
document.addEventListener("touchend", function(e) {
|
||||
scroller.doTouchEnd(e.timeStamp);
|
||||
self.doTouchEnd(e.timeStamp);
|
||||
}, false);
|
||||
|
||||
} else {
|
||||
@@ -542,7 +545,7 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchStart([{
|
||||
self.doTouchStart([{
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY
|
||||
}], e.timeStamp);
|
||||
@@ -555,7 +558,7 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchMove([{
|
||||
self.doTouchMove([{
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY
|
||||
}], e.timeStamp);
|
||||
@@ -568,7 +571,7 @@ var Scroller;
|
||||
return;
|
||||
}
|
||||
|
||||
scroller.doTouchEnd(e.timeStamp);
|
||||
self.doTouchEnd(e.timeStamp);
|
||||
|
||||
mousedown = false;
|
||||
}, false);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
// Initialize Scroller
|
||||
var scroller = new ionic.views.Scroller({
|
||||
content: container,
|
||||
el: container,
|
||||
scrollingX: false
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user