Skip to content

Commit df53083

Browse files
Techincal fixes
1 parent 5b3d07a commit df53083

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

components/com_jtg/assets/js/jtg.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var allpoints = [];
99
function jtgMapInit(mapLayersTitle='Map layers', targetid='jtg_map') {
1010
jtgView = new ol.View( {
1111
center: [0, 0],
12-
units: "m", // TODO: use units from config
1312
maxZoom: 20
1413
} );
1514

components/com_jtg/models/track.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ function updateFile ($id)
731731

732732
$default_map = $input->get('default_map');
733733
$distance = $input->getFloat('distance', 0);
734+
$cfg = JtgHelper::getConfig();
734735
if (strtoupper($cfg->unit)=='MILES') $distance /= 0.621;
735736
$ascent = $input->getInt('ascent', 0);
736737
$descent = $input->getInt('descent', 0);

components/com_jtg/views/track/tmpl/form.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,32 +302,35 @@
302302
</p>
303303
<?php
304304
echo $editor->display('description', $description, '100%', '200px', null, null, false, null);
305-
echo HTMLHelper::_('bootstrap.startAccordion', 'calcVals');
306-
echo HTMLHelper::_('bootstrap.addSlide', 'calcVals', '<div class="jtg-header">'.JText::_('COM_JTG_CALCULATED_VALUES').'</div>', 'collapse1');
305+
if (isset($this->id) && isset($this->gpsTrack))
306+
{
307+
echo HTMLHelper::_('bootstrap.startAccordion', 'calcVals');
308+
echo HTMLHelper::_('bootstrap.addSlide', 'calcVals', '<div class="jtg-header">'.JText::_('COM_JTG_CALCULATED_VALUES').'</div>', 'collapse1');
307309
?>
308310
<table class="table">
309311
<tbody>
310312
<tr>
311313
<td><?php echo JText::_('COM_JTG_DISTANCE'); ?></td>
312314
<td><input id="distance" type="text" name="distance" class="form-control" value="<?php echo $this->track->distance; ?>" /> <?php echo JText::_('COM_JTG_DISTANCE_UNIT_'.strtoupper($this->cfg->unit));
313-
if (isset($this->gpsTrack)) echo ' <font color="grey">( '.JtgHelper::getFormattedDistance($this->gpsTrack->distance, '',$this->cfg->unit).' )</font>'; ?> </td>
315+
echo ' <font color="grey">( '.JtgHelper::getFormattedDistance($this->gpsTrack->distance, '',$this->cfg->unit).' )</font>'; ?> </td>
314316
</tr>
315317
<tr>
316318
<td><?php echo JText::_('COM_JTG_ELEVATION_UP') ?></td>
317319
<td><input id="ascent" type="text" name="ascent" class="form-control" value="<?php echo $this->track->ele_asc; ?>" /> <?php echo JText::_('COM_JTG_ELEVATION_UNIT');
318-
if (isset($this->gpsTrack)) echo ' <font color="grey">( '.$this->gpsTrack->totalAscent.' ) </font>'; ?> </td>
320+
echo ' <font color="grey">( '.$this->gpsTrack->totalAscent.' ) </font>'; ?> </td>
319321
</tr>
320322
<tr>
321323
<td><?php echo JText::_('COM_JTG_ELEVATION_DOWN') ?></td>
322324
<td><input id="descent" type="text" name="descent" class="form-control" value="<?php echo $this->track->ele_desc; ?>" /> <?php echo JText::_('COM_JTG_ELEVATION_UNIT');
323-
if (isset($this->gpsTrack)) echo ' <font color="grey">( '.$this->gpsTrack->totalDescent.' )</font>'; ?> </td>
325+
echo ' <font color="grey">( '.$this->gpsTrack->totalDescent.' )</font>'; ?> </td>
324326
</tr>
325327
</tbody>
326328
</table>
327329
</div>
328330
<?php
329331
echo HTMLHelper::_('bootstrap.endSlide');
330332
echo HTMLHelper::_('bootstrap.endAccordion');
333+
}
331334
$max_images = $this->cfg->max_images;
332335

333336
if (!empty($this->imageList))

0 commit comments

Comments
 (0)