Skip to content

Commit

Permalink
redetects width/height when set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Feb 15, 2016
1 parent c61590d commit 7c2c9af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions d3plus.js
Expand Up @@ -20996,7 +20996,10 @@ module.exports = function(vars) {
} else {
return "relative";
}
}).html("");
});
if (vars.container.changed) {
vars.container.value.html("");
}
ref = ["width", "height"];
for (i = 0, len = ref.length; i < len; i++) {
s = ref[i];
Expand Down Expand Up @@ -34843,9 +34846,7 @@ module.exports = function() {
if (vars.error.value) {
vars.draw.timing = 0;
}
if (vars.container.changed) {
container(vars);
}
container(vars);
small_width = vars.width.value <= vars.width.small;
small_height = vars.height.value <= vars.height.small;
vars.small = small_width || small_height;
Expand Down
3 changes: 2 additions & 1 deletion src/viz/helpers/container.coffee
Expand Up @@ -9,7 +9,8 @@ module.exports = (vars) ->
current = d3.select(this).style("position")
remain = ["absolute","fixed"].indexOf(current) >= 0
if remain then current else "relative"
.html ""

vars.container.value.html "" if vars.container.changed

# Get overall width and height, if not defined
for s in ["width","height"]
Expand Down
2 changes: 1 addition & 1 deletion src/viz/viz.coffee
Expand Up @@ -39,7 +39,7 @@ module.exports = ->
vars.draw.timing = 0 if vars.error.value

# Analyze Container
container vars if vars.container.changed
container vars

# Determine if in "small" mode
small_width = vars.width.value <= vars.width.small
Expand Down

0 comments on commit 7c2c9af

Please sign in to comment.