Closed onli closed 10 years ago
@onli Thanks for the feedback, but I have to say I'm not sure I perfectly understand what the problem is?
I believe the data-url attribute are actually low case like data-subtome-feeds
. Why do you use data-subtomeFeeds
?
@julien51 Thanks for the fast response.
Why do you use data-subtomeFeeds?
It's perfectly possible I missed the point there. In fact, I didn't find the proper documentation. I had a look at https://github.com/superfeedr/subtome/blob/d50147a36aaf06e95bb28cfd4b55cba2fe5ee4e1/app/load.js#L43 and there subtomeBtn.dataset.subtomeFeeds
is read. Is data-subtome-feeds
read at another place, or is there an equivalence as a a js-feature I don't know about?
@onli that's actually the way data-* attributes work: in the HTML they're lowercase and -
separated words and in JS, you access them useing the camelcase version (without the data-
part). This way I believe it's consistent with HTML and JS styling guides. (And in practce they do not designated the same thing)
@julien51 Ok, that would explain it. Lack of knowledge on my part, sorry. Thanks for the help.
No, no, the lesson from this is that we should make it easier to find the docs :)
I'm trying to use the data-* attributes to hardcode the feed that is used when clicking on the button, instead of using autodetection (several in the head). My first approach was
That doesn't work, because Firefox 30 converts this to data-subtomefeeds, the load.js then can't find this. It's only possible to use this mechanism by setting the feeds-dataset via JS (yeah, the code is not actually nice, sorry):
So I have a workaround, but it feels like a bug. Also, it would be nice if the href-element was used directly, if present.
This might be browserspecific, and I might be misunderstanding how this is supposed to be used.