Skip to content

Commit 61d01e6

Browse files
committed
refactor if without not
1 parent 2daab81 commit 61d01e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/legend/draw.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ module.exports = function draw(gd, container) {
3030
var layer;
3131

3232
// Check whether this is the main legend (ie. called without any container)
33-
if(!container) {
34-
container = fullLayout.legend || {};
35-
layer = fullLayout._infolayer;
36-
} else {
33+
if(container) {
3734
layer = container.layer;
3835
clipId += '-hover';
36+
} else {
37+
container = fullLayout.legend || {};
38+
layer = fullLayout._infolayer;
3939
}
4040

4141
var inHover = !!container._inHover;

0 commit comments

Comments
 (0)