[Commits] r1845 - sandbox/ahocevar/playground/trunk/geoext/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Sun Jan 31 14:39:51 CET 2010
Author: ahocevar
Date: 2010-01-31 14:39:51 +0100 (Sun, 31 Jan 2010)
New Revision: 1845
Modified:
sandbox/ahocevar/playground/trunk/geoext/lib/GeoExt/widgets/PrintExtent.js
Log:
renamed currentPage to page; made it an API property
Modified: sandbox/ahocevar/playground/trunk/geoext/lib/GeoExt/widgets/PrintExtent.js
===================================================================
--- sandbox/ahocevar/playground/trunk/geoext/lib/GeoExt/widgets/PrintExtent.js 2010-01-30 11:56:58 UTC (rev 1844)
+++ sandbox/ahocevar/playground/trunk/geoext/lib/GeoExt/widgets/PrintExtent.js 2010-01-31 13:39:51 UTC (rev 1845)
@@ -95,11 +95,11 @@
*/
pages: null,
- /** private: property[currentPage]
+ /** api: property[page]
* :class:`GeoExt.data.PrintPage` The page currently set for
* transformation.
*/
- currentPage: null,
+ page: null,
/** private: method[initComponent]
*/
@@ -138,6 +138,7 @@
this.printProvider.on("layoutchange", this.updateBox, this);
if(!this.initialConfig.pages) {
+ this.page = this.pages[0];
this.map.getCenter() ?
this.fitPage() :
mapPanel.on({
@@ -194,19 +195,19 @@
"beforesetfeature": function(e) {
for(var i=0, len=this.pages.length; i<len; ++i) {
if(this.pages[i].feature === e.feature) {
- this.currentPage = this.pages[i];
+ this.page = this.pages[i];
e.object.rotation = -this.pages[i].rotation;
break;
}
}
},
"beforetransform": function(e) {
- var page = this.currentPage;
+ var page = this.page;
if(e.rotation) {
if(this.printProvider.layout.get("rotation")) {
page.setRotation(-e.object.rotation);
} else {
- e.object.setFeature(this.currentPage.feature);
+ e.object.setFeature(page.feature);
}
} else {
page.fit(e.object.box);
@@ -238,7 +239,7 @@
* Fits the current print page to the map.
*/
fitPage: function() {
- this.currentPage.fit(this.map);
+ this.page.fit(this.map);
},
/** private: method[updateBox]
@@ -246,7 +247,7 @@
* layout, or to fit the box to the extent feature after a tranform.
*/
updateBox: function() {
- var page = this.currentPage;
+ var page = this.page;
this.control.setFeature(page.feature, {rotation: -page.rotation});
},
@@ -269,7 +270,7 @@
}
delete this.layer;
delete this.control;
- delete this.currentPage;
+ delete this.page;
this.rendered = false;
GeoExt.PrintExtent.superclass.beforeDestroy.apply(this, arguments);
}
More information about the Commits
mailing list