[Mapbender-commits] r6290 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jun 17 07:56:03 EDT 2010
Author: christoph
Date: 2010-06-17 11:56:02 +0000 (Thu, 17 Jun 2010)
New Revision: 6290
Added:
trunk/mapbender/lib/wizard.js
Modified:
trunk/mapbender/lib/basic.js
Log:
Modified: trunk/mapbender/lib/basic.js
===================================================================
--- trunk/mapbender/lib/basic.js 2010-06-17 11:32:15 UTC (rev 6289)
+++ trunk/mapbender/lib/basic.js 2010-06-17 11:56:02 UTC (rev 6290)
@@ -381,53 +381,7 @@
return text;
};
-/*
- * Link between various interfaces, imagine a wizard
- */
-$.fn.wizard = function () {
- return this.each(function () {
- var $module = $(this);
- var module = $module.mapbender();
- $module.find("a").each(function () {
- $link = $(this);
- var href = $link.attr("href");
- var $target = $(href);
- if ($target.size() === 0) {
- return;
- }
-
- var target = $target.mapbender();
- var showTarget = function () {
- $target.show();
- };
-
- if (typeof target === "object" && typeof target.show === "function") {
- showTarget = function () {
- // calls the show function of the module, not jQuery's show
- target.show();
- };
- }
-
- var clickHandler = function (e) {
- $module.hide();
- showTarget();
- e.preventDefault();
- };
-
- if (typeof module === "object" && typeof module.hide === "function") {
- clickHandler = function (e) {
- // calls the hide function of the module, not jQuery's hide
- module.hide(showTarget);
- e.preventDefault();
- };
- }
-
- $link.bind("click", clickHandler);
- });
- });
-};
-
/**
* form filling and serializing
*/
Added: trunk/mapbender/lib/wizard.js
===================================================================
--- trunk/mapbender/lib/wizard.js (rev 0)
+++ trunk/mapbender/lib/wizard.js 2010-06-17 11:56:02 UTC (rev 6290)
@@ -0,0 +1,47 @@
+
+/*
+ * Link between various interfaces, imagine a wizard
+ */
+$.fn.wizard = function () {
+ return this.each(function () {
+ var $module = $(this);
+ var module = $module.mapbender();
+ $module.find("a").each(function () {
+ $link = $(this);
+ var href = $link.attr("href");
+ var $target = $(href);
+ if ($target.size() === 0) {
+ return;
+ }
+
+ var target = $target.mapbender();
+
+ var showTarget = function () {
+ $target.show();
+ };
+
+ if (typeof target === "object" && typeof target.show === "function") {
+ showTarget = function () {
+ // calls the show function of the module, not jQuery's show
+ target.show();
+ };
+ }
+
+ var clickHandler = function (e) {
+ $module.hide();
+ showTarget();
+ e.preventDefault();
+ };
+
+ if (typeof module === "object" && typeof module.hide === "function") {
+ clickHandler = function (e) {
+ // calls the hide function of the module, not jQuery's hide
+ module.hide(showTarget);
+ e.preventDefault();
+ };
+ }
+
+ $link.bind("click", clickHandler);
+ });
+ });
+};
\ No newline at end of file
More information about the Mapbender_commits
mailing list