Skip to content

Commit

Permalink
Merge pull request #6360 from vitaliy-bobrov/#6016-transform3d
Browse files Browse the repository at this point in the history
Change translateY to 3d
  • Loading branch information
danbucholtz committed May 9, 2016
2 parents e0cade4 + 529ca54 commit c7e61e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/angular/controller/refresherController.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ IonicModule
}

function overscroll(val) {
scrollChild.style[ionic.CSS.TRANSFORM] = 'translateY(' + val + 'px)';
scrollChild.style[ionic.CSS.TRANSFORM] = 'translate3d(0, ' + val + 'px, 0)';
lastOverscroll = val;
}

Expand Down
8 changes: 4 additions & 4 deletions test/unit/angular/controller/refreshController.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('$ionicRefresh Controller', function() {
setup();

function getTy(el) {
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translateY(', ''));
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translate3d(0px, ', ''));
}

ctrl.__handleTouchmove(evt(0));
Expand All @@ -68,14 +68,14 @@ describe('$ionicRefresh Controller', function() {
ctrl.__handleTouchmove(evt(10));
expect(refresher.classList.contains('invisible')).toBe(false);
ctrl.__handleTouchmove(evt(0));
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translateY(0px)');
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translate3d(0px, 0px, 0px)');
expect(ctrl.__getScrollChild().classList.contains('overscroll')).toBe(false);
expect(refresher.classList.contains('invisible')).toBe(true);
});

it('should activate and deactivate when dragging past activation threshold', function() {
function getTy(el) {
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translateY(', ''));
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translate3d(0px, ', ''));
}
setup();
var domMethods = ctrl.getRefresherDomMethods();
Expand All @@ -92,7 +92,7 @@ describe('$ionicRefresh Controller', function() {

ctrl.__handleTouchmove(evt(0));
timeout.flush();
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translateY(0px)');
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translate3d(0px, 0px, 0px)');
expect(ctrl.__getScrollChild().classList.contains('overscroll')).toBe(false);
expect(refresher.classList.contains('invisible')).toBe(true);
expect(refresher.classList.contains('active')).toBe(false);
Expand Down

0 comments on commit c7e61e4

Please sign in to comment.