diff --git a/index.html b/index.html
index d35c197..e7ac42e 100644
--- a/index.html
+++ b/index.html
@@ -50,7 +50,7 @@
-
+
- Profile
@@ -116,6 +116,7 @@
+
diff --git a/js/control/Profile.js b/js/control/Profile.js
index 5892655..3b9268c 100644
--- a/js/control/Profile.js
+++ b/js/control/Profile.js
@@ -1,18 +1,7 @@
-BR.Profile = BR.Control.extend({
- options: {
- divId: 'profile_div'
- },
-
- onAdd: function (map) {
+BR.Profile = L.Class.extend({
+ initialize: function () {
L.DomUtil.get('profile_upload').onsubmit = L.bind(this._submit, this);
L.DomUtil.get('clear').onclick = L.bind(this.clear, this);
-
- $('#tab a').click(function (e) {
- e.preventDefault();
- $(this).tab('show');
- });
-
- return BR.Control.prototype.onAdd.call(this, map);
},
clear: function(evt) {
diff --git a/js/control/Tabs.js b/js/control/Tabs.js
new file mode 100644
index 0000000..40b60c5
--- /dev/null
+++ b/js/control/Tabs.js
@@ -0,0 +1,14 @@
+BR.Tabs = BR.Control.extend({
+ options: {
+ divId: 'tabs_div'
+ },
+
+ onAdd: function (map) {
+ $('#tab a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ });
+
+ return BR.Control.prototype.onAdd.call(this, map);
+ }
+});
diff --git a/js/index.js b/js/index.js
index ceed328..214e8a6 100644
--- a/js/index.js
+++ b/js/index.js
@@ -196,7 +196,7 @@
stats.addTo(map);
download.addTo(map);
elevation.addTo(map);
- profile.addTo(map);
+ map.addControl(new BR.Tabs());
nogos.addTo(map);
routing.addTo(map);