Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions dist/js/epoch.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ QueryCSS = (function() {
};

QueryCSS.getStyles = function(selector, container) {
var cache, cacheKey, el, element, i, j, k, len, len1, len2, name, parent, parentNode, parents, ref, ref1, ref2, root, sel, selectorList, styles, subSelector;
var cache, cacheKey, el, element, error, i, j, k, len, len1, len2, name, parent, parentNode, parents, ref, ref1, ref2, ref3, root, sel, selectorList, styles, subSelector;
cacheKey = QueryCSS.hash(selector, container);
cache = QueryCSS.cache[cacheKey];
if (cache != null) {
Expand Down Expand Up @@ -956,10 +956,14 @@ QueryCSS = (function() {
if (logging) {
console.log(selectorList);
}
sel = 'WTF-' + selector.replace(/(\.|\#| )/g, '__');
parent = root = put(selectorList.shift());
while (selectorList.length) {
el = put(selectorList.shift());
parent.appendChild(el);
if (!selectorList.length && !el.id) {
el.id = sel;
}
parent = el;
}
if (logging) {
Expand All @@ -968,10 +972,16 @@ QueryCSS = (function() {
QueryCSS.getContainer().node().appendChild(root);
ref = d3.select('#' + REFERENCE_CONTAINER_ID + ' ' + selector);
styles = {};
ref2 = QueryCSS.styleList;
for (k = 0, len2 = ref2.length; k < len2; k++) {
name = ref2[k];
styles[name] = ref.style(name);
ref3 = QueryCSS.styleList;
for (k = 0, len2 = ref3.length; k < len2; k++) {
name = ref3[k];
try {
styles[name] = ref.style(name);
} catch (error1) {
error = error1;
ref2 = Epoch.Util.getComputedStyle(document.getElementById(sel), null);
styles[name] = ref2[name];
}
}
QueryCSS.cache[cacheKey] = styles;
QueryCSS.getContainer().html('');
Expand Down
6 changes: 3 additions & 3 deletions dist/js/epoch.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "epoch-charting",
"version": "0.8.4",
"description": "A general purpose real-time charting library for building beautiful, smooth, and high performance visualizations.",
"name": "epoch-charting-ie-patched",
"version": "0.8.4-patched",
"description": "A general purpose real-time charting library for building beautiful, smooth, and high performance visualizations. With patch resolving IE rendering.",
"keywords": [
"chart",
"charting",
Expand All @@ -19,7 +19,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/fastly/epoch.git"
"url": "https://github.com/fixanoid/epoch.git"
},
"main": "dist/js/epoch.js",
"dependencies": {
Expand Down
20 changes: 17 additions & 3 deletions src/core/css.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class QueryCSS

return element

# Lets the user set whether or not to log selector lists and resulting DOM trees.
# Lets the user set whether or not to log selector lists and resulting DOM trees.
# Useful for debugging QueryCSS itself.
@log: (b) ->
logging = b
Expand Down Expand Up @@ -106,26 +106,40 @@ class QueryCSS

console.log(selectorList) if logging

sel = 'WTF-' + selector.replace(/(\.|\#| )/g, '__')

parent = root = put(selectorList.shift())
while selectorList.length
el = put(selectorList.shift())
parent.appendChild el

if !selectorList.length && !el.id
el.id = sel

parent = el

console.log(root) if logging

# 2) Place the reference tree and fetch styles given the selector
QueryCSS.getContainer().node().appendChild(root)


ref = d3.select('#' + REFERENCE_CONTAINER_ID + ' ' + selector)

styles = {}

for name in QueryCSS.styleList
styles[name] = ref.style(name)
try
styles[name] = ref.style(name)
catch error
ref2 = Epoch.Util.getComputedStyle(document.getElementById(sel), null)
styles[name] = ref2[name]

QueryCSS.cache[cacheKey] = styles

# 3) Cleanup and return the styles
QueryCSS.getContainer().html('')
return styles


Epoch.QueryCSS = QueryCSS
Epoch.QueryCSS = QueryCSS