[OpenLayers-Commits] r11573 - in trunk/openlayers/lib/OpenLayers: .
BaseTypes
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Mon Feb 28 03:06:00 EST 2011
Author: fredj
Date: 2011-02-28 00:05:56 -0800 (Mon, 28 Feb 2011)
New Revision: 11573
Modified:
trunk/openlayers/lib/OpenLayers/BaseTypes/Element.js
trunk/openlayers/lib/OpenLayers/Popup.js
Log:
deprecate OpenLayers.Element hide() / show(). r=crschmidt (closes #1099)
Modified: trunk/openlayers/lib/OpenLayers/BaseTypes/Element.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/Element.js 2011-02-28 01:57:51 UTC (rev 11572)
+++ trunk/openlayers/lib/OpenLayers/BaseTypes/Element.js 2011-02-28 08:05:56 UTC (rev 11573)
@@ -45,12 +45,16 @@
/**
* APIFunction: hide
- * Hide element(s) passed in
+ * *Deprecated*. Hide element(s) passed in
*
* Parameters:
* element - {DOMElement} Actually user can pass any number of elements
*/
hide: function() {
+ OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
+ newMethod: "element.style.display = 'none';"
+ }));
+
for (var i=0, len=arguments.length; i<len; i++) {
var element = OpenLayers.Util.getElement(arguments[i]);
if (element) {
@@ -61,12 +65,16 @@
/**
* APIFunction: show
- * Show element(s) passed in
+ * *Deprecated*. Show element(s) passed in
*
* Parameters:
* element - {DOMElement} Actually user can pass any number of elements
*/
show: function() {
+ OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
+ newMethod: "element.style.display = '';"
+ }));
+
for (var i=0, len=arguments.length; i<len; i++) {
var element = OpenLayers.Util.getElement(arguments[i]);
if (element) {
Modified: trunk/openlayers/lib/OpenLayers/Popup.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Popup.js 2011-02-28 01:57:51 UTC (rev 11572)
+++ trunk/openlayers/lib/OpenLayers/Popup.js 2011-02-28 08:05:56 UTC (rev 11573)
@@ -431,7 +431,7 @@
* Makes the popup visible.
*/
show: function() {
- OpenLayers.Element.show(this.div);
+ this.div.style.display = '';
if (this.panMapIfOutOfView) {
this.panIntoView();
@@ -443,7 +443,7 @@
* Makes the popup invisible.
*/
hide: function() {
- OpenLayers.Element.hide(this.div);
+ this.div.style.display = 'none';
},
/**
More information about the Commits
mailing list