[Pkg-javascript-commits] [leaflet] 231/301: add Path className option

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet.

commit c96384ef82bdeb7ef07579a5882291726fb65e44
Author: Vladimir Agafonkin <agafonkin at gmail.com>
Date:   Tue Nov 12 22:57:21 2013 +0200

    add Path className option
---
 src/layer/vector/Path.SVG.js | 5 +++++
 src/layer/vector/Path.VML.js | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/layer/vector/Path.SVG.js b/src/layer/vector/Path.SVG.js
index 3abdfb8..30c11ad 100644
--- a/src/layer/vector/Path.SVG.js
+++ b/src/layer/vector/Path.SVG.js
@@ -50,6 +50,11 @@ L.Path = L.Path.extend({
 		this._container = this._createElement('g');
 
 		this._path = this._createElement('path');
+
+		if (this.options.className) {
+			L.DomUtil.addClass(this._path, this.options.className);
+		}
+
 		this._container.appendChild(this._path);
 	},
 
diff --git a/src/layer/vector/Path.VML.js b/src/layer/vector/Path.VML.js
index 038b4aa..5410604 100644
--- a/src/layer/vector/Path.VML.js
+++ b/src/layer/vector/Path.VML.js
@@ -40,10 +40,14 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({
 
 	_initPath: function () {
 		var container = this._container = this._createElement('shape');
-		L.DomUtil.addClass(container, 'leaflet-vml-shape');
+
+		L.DomUtil.addClass(container, 'leaflet-vml-shape' +
+			(this.options.className ? ' ' + this.options.className : ''));
+
 		if (this.options.clickable) {
 			L.DomUtil.addClass(container, 'leaflet-clickable');
 		}
+
 		container.coordsize = '1 1';
 
 		this._path = this._createElement('path');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git



More information about the Pkg-javascript-commits mailing list