Skip to content

Instantly share code, notes, and snippets.

@brettp
Created June 15, 2011 14:39
Show Gist options
  • Save brettp/1027253 to your computer and use it in GitHub Desktop.
Save brettp/1027253 to your computer and use it in GitHub Desktop.
APLJHU Elgg Answers plugin arrow fix
diff --git a/www/mod/answers/views/default/answers/css.php b/www/mod/answers/views/default/answers/css.php
index ccda03b..c3092ca 100644
--- a/www/mod/answers/views/default/answers/css.php
+++ b/www/mod/answers/views/default/answers/css.php
@@ -16,27 +16,19 @@
margin: 0;
}
-.answer_rate span:after {
+.answer_rate .arrow {
font-size: 24px;
font-weight: bold;
color: #777;
width: 24px;
}
-.answer_rate:hover {
- text-decoration: none;
-}
-
-.answers_like span:after {
- content: "\25B2";
-}
-
-.answers_dislike span:after {
- content: "\25BC";
+.answers_like_selected .arrow, .answers_dislike_selected .arrow {
+ color: #0054a7;
}
-.answers_like_selected span:after, .answers_dislike_selected span:after {
- color: #0054a7;
+.answer_rate:hover {
+ text-decoration: none;
}
.answers_choose {
diff --git a/www/mod/answers/views/default/answers/rating_icon.php b/www/mod/answers/views/default/answers/rating_icon.php
index 87574b1..170348f 100644
--- a/www/mod/answers/views/default/answers/rating_icon.php
+++ b/www/mod/answers/views/default/answers/rating_icon.php
@@ -9,9 +9,10 @@ $tooltip = $vars['tooltip'];
$type = $vars['type'];
$selected = $vars['selected'];
$href = $vars['href'];
-
+
$class = "answers_" . $type . ($selected ? " answers_" . $type . "_selected" : "");
+$arrow = ($type == 'like') ? '▲' : '▼';
?>
<a title="<?php echo elgg_echo("answers:answer:tooltip:$tooltip"); ?>" class="answer_rate <?php echo $class; ?>" href="<?php echo $href; ?>" onclick="$(this).closest('.answers_rating_block').parent().load('<?php echo $href . "&ajax=true"; ?>');return false;">
- <span></span>
+ <span class="arrow"><?php echo $arrow; ?></span>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment