extract Control from Profile class into Tabs control
This commit is contained in:
parent
c190f6d48a
commit
bb371a30a7
4 changed files with 19 additions and 15 deletions
|
|
@ -50,7 +50,7 @@
|
|||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="profile_div" class="hidden">
|
||||
<div id="tabs_div" class="hidden">
|
||||
|
||||
<ul id="tab" class="nav nav-tabs" role="tablist">
|
||||
<li class="active"><a href="#tab_profile" role="tab">Profile</a></li>
|
||||
|
|
@ -116,6 +116,7 @@
|
|||
<script src="js/plugin/Permalink.Routing.js"></script>
|
||||
<script src="js/control/TrackStats.js"></script>
|
||||
<script src="js/control/Download.js"></script>
|
||||
<script src="js/control/Tabs.js"></script>
|
||||
<script src="js/control/Profile.js"></script>
|
||||
<script src="js/control/RoutingOptions.js"></script>
|
||||
<script src="js/control/Message.js"></script>
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
14
js/control/Tabs.js
Normal file
14
js/control/Tabs.js
Normal file
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue