Closed mtkopone closed 12 years ago
Sorry for the late reply, I was travelling for a month without access to the Internet.
Thanks for reporting the bug. Definitely, IE8 needs to be supported. Will fix.
Uah, I located the bug. It's kind of nasty to fix, IE8 DOM implementation is seriously broken (surprise..).
Transparency extends matching DOM elements with element.transparency object, which contains some internal info, e.g., the text rendered to the node. Apparently, in IE8, extending DOM elements with objects doesn't work.
jQuery extends DOM elements only with cache id, storing the data elsewhere. Similar approach should fix the problem, but it might take a day or two, before I've enough time to do the implementation.
Background info: http://perfectionkills.com/whats-wrong-with-extending-the-dom/
Even Element.cloneNode() is broken in IE8 and below. https://github.com/jquery/jquery/blob/master/src/manipulation.js#L585
I'm seriously reconsidering introducing jQuery dependency in order to ensure interoperability and legacy support..
Dealing with IE8 can be a real pain...
We're currently using transparency.js in the following way:
var $template = $('#templateId').detach().removeAttr('id')
...
$output.append($template.clone().render(data, directives))
So I figured it'd be ok to comment out line 220, the one that says: "if (!e || !(content != null) || e.transparency.content === content) return;"
Seems to do the trick, but I didn't go deep enough to check what side-effects this could have...
Finally fixed: https://github.com/leonidas/transparency/commit/bee5a9b701e0358588e8f42e88f780947e35f8dc
The solution you suggested should work in the scenario above. However, element.transparency.model
would still point to first model in the list, instead of the model that was actually rendered. This would break event handlers, which are using the model data, e.g.
https://github.com/leonidas/transparency/blob/master/examples/todo-app/index.html#L41
The fix in the commit above ensures that the Transparency data is not shared between template instances.
Cool, thanks!
Hi, and sorry about moaning about legacy browsers, but:
The following page outputs 'Same Same' on all browsers expect IE8, where it outputs 'Same'.