Skip to content

Commit

Permalink
Add relative class by javascript
Browse files Browse the repository at this point in the history
Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Mar 18, 2014
1 parent 0ffeb8e commit 57397fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions sources/Load.php
Expand Up @@ -1671,6 +1671,7 @@ function loadTheme($id_theme = 0, $initialize = true)
years : ' . JavaScriptEscape($txt['rt_years']) . ',
});
updateRelativeTime();', true);
$context['using_relative_time'] = true;
}

// Queue our Javascript
Expand Down
6 changes: 5 additions & 1 deletion themes/default/MessageIndex.template.php
Expand Up @@ -215,7 +215,7 @@ function template_topic_listing()
<ul class="small_pagelinks" id="pages' . $topic['first_post']['id'] . '" role="menubar">' . $topic['pages'] . '</ul>' : '', '
</div>
</div>
<div class="topic_latest', (!empty($modSettings['todayMod']) && $modSettings['todayMod'] > 2) ? ' relative' : ' dd', '">
<div class="topic_latest">
<p class="topic_stats">
', $topic['replies'], ' ', $txt['replies'], '<br />
', $topic['views'], ' ', $txt['views'];
Expand Down Expand Up @@ -340,6 +340,10 @@ function template_topic_listing_below()
echo '
<script><!-- // --><![CDATA[';

if (!empty($context['using_relative_time']))
echo '
$(\'.topic_latest\').addClass(\'relative\');';

if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
echo '
aJumpTo[aJumpTo.length] = new JumpTo({
Expand Down

0 comments on commit 57397fc

Please sign in to comment.