[Mapbender-commits] r6109 - branches/3_dev/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun May 9 09:28:47 EDT 2010


Author: christoph
Date: 2010-05-09 09:28:46 -0400 (Sun, 09 May 2010)
New Revision: 6109

Added:
   branches/3_dev/http/plugins/mb_pane.js
   branches/3_dev/http/plugins/mb_toolbar.js
Log:


Added: branches/3_dev/http/plugins/mb_pane.js
===================================================================
--- branches/3_dev/http/plugins/mb_pane.js	                        (rev 0)
+++ branches/3_dev/http/plugins/mb_pane.js	2010-05-09 13:28:46 UTC (rev 6109)
@@ -0,0 +1,44 @@
+var $pane = $(this);
+
+var PaneApi = function (o) {
+	var that = this;
+	var paneOptions = {};
+	var paneTypes = ["center", "west", "east", "north", "south"];
+	
+	for (var i in paneTypes) {
+		var type = paneTypes[i];
+		if (o[type]) {
+			var $currentPane = $("#" + o[type]);
+			if (!$currentPane.is("div") && !$currentPane.is("iframe")) {
+				$currentPane = $currentPane.wrap("<div></div>").parent();
+			}
+			$currentPane.appendTo($pane).addClass("ui-layout-" + type).addClass("pane");
+		}
+	}
+	
+	var myOptions = $.extend({
+		applyDefaultStyles: false,
+		center__onresize: function (name, element, state, options, layoutName) {
+			$(element).mapbender("setDimensions", $(element).innerWidth(), $(element).innerHeight());
+		},
+		onresize: function (name, element, state, options, layoutName) {
+			try {
+				$(element).mapbender("setDimensions", $(element).innerWidth(), $(element).innerHeight());
+			}
+			catch (e) {
+			}
+		}
+	}, o.layoutOptions);
+	var layout = $pane.layout(myOptions);
+	layout.resizeAll();
+	
+	this.resizeAll = function () {
+		layout.resizeAll();
+	};
+	
+	Mapbender.events.afterInit.register(function () {
+		that.resizeAll();
+	});
+};
+
+$pane.mapbender(new PaneApi(options));

Added: branches/3_dev/http/plugins/mb_toolbar.js
===================================================================
--- branches/3_dev/http/plugins/mb_toolbar.js	                        (rev 0)
+++ branches/3_dev/http/plugins/mb_toolbar.js	2010-05-09 13:28:46 UTC (rev 6109)
@@ -0,0 +1,20 @@
+var $toolbar = $(this);
+
+var ToolbarApi = function () {
+	var that = this;
+	
+	var init = function () {
+		$(options.target).each(function () {
+			$("#" + this).css({
+				"position": "relative",
+				"display":"",
+				"top":"",
+				"left":""
+			}).appendTo($toolbar);
+		});
+	};
+
+	init();
+};
+
+$toolbar.mapbender(new ToolbarApi());



More information about the Mapbender_commits mailing list