don't calculateInRange if it's not needed. r=elemoine (closes #2400)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9958 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2010-01-22 08:13:11 +00:00
parent e562626f87
commit 822e8f5485

View File

@@ -644,9 +644,8 @@ OpenLayers.Layer = OpenLayers.Class({
* display - {Boolean}
*/
display: function(display) {
var inRange = this.calculateInRange();
if (display != (this.div.style.display != "none")) {
this.div.style.display = (display && inRange) ? "block" : "none";
this.div.style.display = (display && this.calculateInRange()) ? "block" : "none";
}
},