ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Errors in console log: new Zynga scroller and sideMenu controller

Open xAlien95 opened this issue 12 years ago • 11 comments

With the new Zynga scroller there's an error in the console log when you scroll with touch:

Uncaught TypeError: Cannot read property 'scrollTop' of undefined ionic-angular.js:741
(anonymous function) ionic-angular.js:741
x.event.dispatch jquery-2.0.3.min.js:5
x.event.add.y.handle jquery-2.0.3.min.js:5
ionic.EventController.trigger ionic.js:252
(anonymous function) ionic.js:2417
ionic.Utils.throttle ionic.js:1986
ionic.views.Scroll.ionic.views.View.inherit.getRenderFn.content.style.(anonymous function) ionic.js:2720
ionic.views.Scroll.ionic.views.View.inherit.__publish ionic.js:3581
ionic.views.Scroll.ionic.views.View.inherit.scrollTo ionic.js:3061
ionic.views.Scroll.ionic.views.View.inherit.doTouchEnd ionic.js:3477
(anonymous function) ionic.js:2663

The second error has been partially fixed weeks ago; when you use the sideMenu controller there's an error with function names (pushDown, bringUp):

TypeError: Object #<Object> has no method 'pushDown'
    at ionic.controllers.SideMenuController.ionic.controllers.ViewController.inherit.openAmount (http://uxiedex.altervista.org/js/ionic.js:5591:32)
    at ionic.controllers.SideMenuController.ionic.controllers.ViewController.inherit.openPercentage (http://uxiedex.altervista.org/js/ionic.js:5552:14)
    at ionic.controllers.SideMenuController.ionic.controllers.ViewController.inherit.toggleRight (http://uxiedex.altervista.org/js/ionic.js:5497:14)
    at Scope.$scope.toggleMenu (http://uxiedex.altervista.org/js/app.js:5:30)
    at Parser.functionCall (http://uxiedex.altervista.org/js/angular/angular-scenario.js:19735:21)
    at http://uxiedex.altervista.org/js/angular/angular-touch.js:426:9
    at Scope.$get.Scope.$eval (http://uxiedex.altervista.org/js/angular/angular-scenario.js:21426:28)
    at Scope.$get.Scope.$apply (http://uxiedex.altervista.org/js/angular/angular-scenario.js:21526:23)
    at HTMLButtonElement.<anonymous> (http://uxiedex.altervista.org/js/angular/angular-touch.js:425:13)
    at HTMLButtonElement.x.event.dispatch (http://uxiedex.altervista.org/js/jquery-2.0.3.min.js:5:10006) angular-scenario.js:18951

In ionic.js#L5589 you should replace lines:

this.right && this.right.bringUp();
this.left && this.left.pushDown();

with:

this.right && this.right.bringUp && this.right.bringUp();
this.left && this.left.pushDown && this.left.pushDown();

Feel free to go to the page mentioned in the error log if you want to personallt see the error; I replaced the alpha fox version with the actual github /dist folder. Thanks :3

xAlien95 avatar Dec 08 '13 14:12 xAlien95

Hey @xAlien95, the scroll issue was fixed already, maybe you pulled from master at just the wrong time :) Maybe check master to see if the problem is solved?

I made a quick commit for the second issue. Thanks!

mlynch avatar Dec 08 '13 18:12 mlynch

@mlynch I noticed you only edited the sideMenuController.js file, not the complete file in /dist folder. How could I get the updated ionic.js and ionic-angular.js? Thank you :)

xAlien95 avatar Dec 08 '13 19:12 xAlien95

Hey, I did end up pushing a complete update recently, and the most recent release has it in there. Maybe try that one?

mlynch avatar Dec 08 '13 19:12 mlynch

I'm alredy using it (the fixed version of alpha fox 0.9.14.. without the scroll thing you were testing for the next releases of Ionic). This error is showing:

Uncaught TypeError: Cannot read property 'scrollTop' of undefined ionic-angular.js:741

You can see it here, touching the content div or scrolling it. Thanks :)

xAlien95 avatar Dec 08 '13 20:12 xAlien95

Ah, looks like an interaction issue with jQuery. I'll see about fixing that.

On Sun, Dec 8, 2013 at 2:11 PM, Stefano De Carolis <[email protected]

wrote:

I'm alredy using it (the fixed version of alpha fox 0.9.14.. without the scroll thing you were testing for the next releases of Ionic). This error is showing:

Uncaught TypeError: Cannot read property 'scrollTop' of undefined ionic-angular.js:741

You can see it here http://uxiedex.altervista.org/, touching the content div or scrolling it. Thanks :)

— Reply to this email directly or view it on GitHubhttps://github.com/driftyco/ionic/issues/293#issuecomment-30091398 .

mlynch avatar Dec 08 '13 20:12 mlynch

Woohoo, the scrollTop undefined issue was getting really annoying.

adhsu avatar Dec 08 '13 20:12 adhsu

I have the same problem, I don't know how to fix this...

benmliang avatar Dec 08 '13 20:12 benmliang

Okay, I just fixed this in master. Mind giving it a try to see if it's working for you now? Thanks.

mlynch avatar Dec 08 '13 21:12 mlynch

Thanks @mlynch! It works now :+1:

xAlien95 avatar Dec 08 '13 21:12 xAlien95

It works :dancers:

benmliang avatar Dec 08 '13 23:12 benmliang

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 06 '18 02:09 ionitron-bot[bot]