Few micro changes and optimizations from various authors #2

Open
wants to merge 8 commits into
from

Projects

None yet

4 participants

@voituk
Contributor
voituk commented Oct 26, 2010

Here is few changes in this batch:

  1. Fixed bug in hash:changed event implementation
  2. Cookie code optimizations from Victor Homaykov
  3. Documentation micro-fix
  4. Element.centerInParent implementation from some guy from Mexico.

Any comments? Objections?

voituk and others added some commits Oct 4, 2010
@voituk voituk Updated array documentation 11f3244
@victor-homyakov @voituk victor-homyakov Changed Cookie#get ac853fe
@voituk voituk Merged optimized version of Cookie.get 183ee2b
@RumataMx @voituk RumataMx Element.centerInParent could be adapted to center the element in anot…
…her element, given that the container is relatively positioned and has defined dimentions, although this would mean that the element to be centered within another should be moved in the context of the mark up. Ha ve to do that later and refine the method.
e1e0a81
@voituk voituk Merge branch 'master' of github.com:voituk/protolicious a0a093b
@voituk voituk Fixed hash_changed typos prevented the snippet to work. f7b660d
@voituk voituk Fixed: this is unknown in this context 46090dd
Owner
kangax commented Dec 3, 2010

Thanks for tackling these :) Few comments:

  • What was the bug in hash:changed? Is it trailing ().call(null) part?
  • What is cookie code optimized for? Size? Does it also fix something? find + startsWith could make it slow (for long strings or those consisting of many values)
  • Element#centerInParent sets style "manually"; could use Element.setStyle. I don't care much which one it is; depends on whether size matters more than speed or vice versa (so should be modified accordingly)
Contributor
voituk commented Dec 4, 2010

Oh, it was so much time ago, so i don't remember all details :)
Anyway will try to describe you:

  • Fixed hash_changed typos prevented the snippet to work.
    voituk/protolicious@f7b660d
    There was a typo: you've initialized the hash variable, but current variable was used in the code above
  • I've removed the trailing .call(null) block because you're calling it on result of top-level function, that is not returning the function in fact. So the browser displays error message.
  • Yeah, the cookie code was optimized for size. I haven't tested it's performance, so i don't know which version will be faster. I think you know better than me which one version is good.
  • Element#centerInParent - fixed in c60f39b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment