I'm now working with javascript part of dom pod and found some minor issues.
ElemPeerget and set methods are not complementary. get() uses this.elem[name] to access element's attributes while set() uses setAttribute. The problem is this.elem[name] does not return custom attributes. I changed this call to this.elem.getAttribute(name) and it works as it should.
ElemPeerfind and findAll have the same typo in the code. Argument function name is f, but it is also referred as func - clearly untested use cases.
I've tried to insert some code chunks here but failed with formatting. Cheatsheet does not help much :)
andyWed 16 Oct 2013
Hey @morokhovets - thanks for reporting. The best way to get us patches is send a pull request on BitBucket:
morokhovets Wed 16 Oct 2013
Hello,
I'm now working with javascript part of
dom
pod and found some minor issues.ElemPeer
get
andset
methods are not complementary.get()
usesthis.elem[name]
to access element's attributes whileset()
usessetAttribute
. The problem isthis.elem[name]
does not return custom attributes. I changed this call tothis.elem.getAttribute(name)
and it works as it should.ElemPeer
find
andfindAll
have the same typo in the code. Argument function name isf
, but it is also referred asfunc
- clearly untested use cases.I've tried to insert some code chunks here but failed with formatting. Cheatsheet does not help much :)
andy Wed 16 Oct 2013
Hey @morokhovets - thanks for reporting. The best way to get us patches is send a pull request on BitBucket:
https://bitbucket.org/fantom/fan-1.0
Indent all your code 2 spaces to mark as <pre> block.
SlimerDude Wed 16 Oct 2013
I find indenting spaces a bit of a chore and do this instead:
morokhovets Thu 17 Oct 2013
Now trying with
pre
Notice
func
references.Looks like
pre
works! Thanks!andy Mon 18 Nov 2013
FYI - this patch landed - thanks @morokhovets!