Remove extra event firing logic from Layer::setVisibility

This commit is contained in:
Matt Priour
2012-10-09 12:21:25 -05:00
parent f17a3c70e4
commit e8cc0deeb5
2 changed files with 4 additions and 7 deletions

View File

@@ -859,7 +859,7 @@
}
function test_display(t) {
t.plan(8);
t.plan(9);
var map, layer, log;
@@ -887,11 +887,14 @@
layer.display(true);
t.eq(layer.div.style.display, "block", "display() set layer's display style to correct value");
t.eq(layer.getVisibility(), false, "display() does not affect layer's visibility state");
layer.setVisibility(true);
// This call must not trig the event because the opacity value is the same.
log = [];
layer.display(true);
t.eq(log.length, 0, "display() does not trigger changelayer if the display value is the same");
layer.setVisibility(false);
t.eq(log.length, 1, "changelayer event called only once. setVisibility doesn't fire any extra changelayer events");
}
/******