Skip to content

Commit 6e20634

Browse files
committed
fix refrence from inside async function to anchorAx
1 parent 6a052c4 commit 6e20634

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plots/cartesian/axes.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,11 +3137,15 @@ axes.drawLabels = function(gd, ax, opts) {
31373137

31383138
ax._hideCounterAxisInsideTickLabels = function(partialOpts) {
31393139
var isX = ax._id.charAt(0) === 'x';
3140+
3141+
var anchoredAxes = [];
31403142
for(var subplot in fullLayout._plots) {
31413143
var plotinfo = fullLayout._plots[subplot];
31423144
if(ax._id !== plotinfo.xaxis._id && ax._id !== plotinfo.yaxis._id) continue;
3143-
var anchorAx = isX ? plotinfo.yaxis : plotinfo.xaxis;
3145+
anchoredAxes.push(isX ? plotinfo.yaxis : plotinfo.xaxis);
3146+
}
31443147

3148+
anchoredAxes.forEach(function(anchorAx) {
31453149
if(anchorAx && insideTicklabelposition(anchorAx)) {
31463150
(partialOpts || [
31473151
ZERO_PATH,
@@ -3181,7 +3185,7 @@ axes.drawLabels = function(gd, ax, opts) {
31813185
});
31823186
});
31833187
}
3184-
}
3188+
});
31853189
};
31863190

31873191
// make sure all labels are correctly positioned at their base angle

0 commit comments

Comments
 (0)