Joined May 2013
·

Kenneth

Senior developer at Globalmouth
·
Stockholm, Sweden
·
·
·

Posted to 3 IOS Homescreen Web App tips over 1 year ago

Yep, IOS 8 broke them. Also the password field cant be forced to numeric keyboard anymore either..

Posted to JavaScript *this* keyword over 1 year ago

Dont forget .bind( this ) with .call and .apply. Its quite handy if for instance you do not wanna lose scope when attaching an event listener in a class like function.

Posted to JavaScript - Module pattern over 1 year ago

Why not just use what is available, like RequireJS or CommonJS to achieve a modularized system. That would be much easier in terms of setup and would not need objects in objects and scope isolation.

I have used this technique before as well and i like the AMD method a lot better.

Especially on big projects it gets so messy. I do really like the revealing module pattern though and would definitely recommend that, but i would do it with requirejs to not have to worry about if i can access a module or not and can easily create seperate modules that do not have to be bound to a myApp object for instance.

Thanks for this, was a good read. I haven't created promises myself yet in AngularJS, at least not with Q.

Posted to CSS3 performance on mobile devices over 1 year ago

I agree with Matt, you should not be using translateZ as your go to performance solutions, theres a lot more to it i would say. Reference http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/ and talk about the stuff that animates cheaply: translate, opacity and scale. It's important to remember that those properties create the highest performance, not actually hacking in a translateZ to get GPU support. That's a faulty solution in general because it has to send it to the GPU, which causes a slight delay and causes the device to run hotter.

I read up on this article and it's really interesting about performance and animations and i would recommend looking into it to get a better grasp of what is going on under the hood. http://css-tricks.com/myth-busting-css-animations-vs-javascript/

Besides that good basic tips, the backface might also be handy to note that it causes a flicker when animating, a white flicker. It's a good tip to remember that when translating cause it can cause a headache to figure out where the white flashes are coming from if youre animating an object without the backface being hdiden (when making a cardflip for example)

Thanks for the tips, ill have a look if it increases performance. Otherwise i might step away from CSS3 and actually use the GSAP library to create better performance animations.

Posted to Never lose scope again by binding over 1 year ago

Thanks for the comment, but if .apply and .call immediately invoke the function, don't they? For instance say im doing something like

myFoo.success myBar.apply(@) then it will execute before its called via success cause it calls it immediately where .bind then has the benefit of wrapping the this in there and not actually executing it. I have a lot of times that im using some plugin or framework where i do not actually control the function execution, else i prefer .apply if i can help it.

Interesting read up, but it looks like a messy job to achieve what you wanted.

Why don't you declare the template_path in the constructor for instance? Can't you just extend the constructor via super()? I wouldn't start messing with @prototype for vars. Those should be in the constructor in my opinion.

Doesn't it work to just move the template path to the constructor and declare it via @templatepath instead of prototype?
Then call super() in the extended one and the @template should have access to @template
path and you can access that from outside as well.

I haven't tried this but it feels like that should work and it should achieve what you're trying to do via prototype. Let me know, i might be missing a reason for putting it there..

You could also always achieve something similar with a object mixin, which might actually be nicer than enforcing classical object oriented patterns. I mean the classes from coffeescript basically do copying of the object anyway..

Let me know!

Posted to Preventing elastic scroll over 1 year ago

Can't you do something less drastic by just using overflow-y: scroll without using -webkit-overflow-scrolling: touch;

I am assuming you are trying to disable elastic scrolling on iPhones. Isnt using overflow-y: scroll without -webkit-overflow-scrolling exactly that? I might be wrong here, let me know!

Achievements
115 Karma
18,178 Total ProTip Views