Skip to content

Commit

Permalink
setup background image for flagging button
Browse files Browse the repository at this point in the history
  • Loading branch information
jayseeg committed Apr 12, 2012
1 parent af178ff commit d429167
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 1 addition & 3 deletions app/View/Pages/view.ctp
Expand Up @@ -30,16 +30,14 @@
if($flagged){
$flag = 'Flagged';
$href = '';
$span = '⚑';
} else {
$flag = 'Flag';
$href = 'href="javascript:void(1);"';
$span = '⚐';
}
echo $this->Form->create('Flag', array('url'=>'/pages/flag'));
echo $this->Form->hidden('user_ip', array('value'=>$userIP));
echo $this->Form->hidden('haikwitter_id', array('value'=>$entry['Haiku']['id']));
echo '<div class="hidden ajaxSubmit"><a ' . $href . ' title="Flag this post as innappropriate" class="' . $flag . ' flag-button">' . $flag . ' <span>' . $span . '</span></a></div>';
echo '<div class="hidden ajaxSubmit"><a ' . $href . ' title="Flag this post as innappropriate" class="' . $flag . ' flag-button">' . $flag . ' <span></span></a></div>';
echo $this->Form->end(array('label'=>'Flag', 'name'=>'flag', 'div'=>false, 'class'=>'flag-submit flag flag-button ' . $flag));
?>
</div>
Expand Down
9 changes: 7 additions & 2 deletions app/webroot/css/900_style.css
Expand Up @@ -368,7 +368,7 @@ input.form-error {
color: #fff;
font-family: sans-serif;
font-size: 11px;
line-height: 20px;
line-height: 23px;
text-decoration: none;

border-radius: 3px;
Expand All @@ -393,7 +393,12 @@ input.flag-button {
position: relative;
display: inline-block;
top: 2px;
font-size: 16px;
height: 12px;
width: 10px;
background: url(../img/flag.png) no-repeat left bottom;
}
.Flagged span {
background-position: left top;
}
.Flag,
input.Flagged {
Expand Down
Binary file added app/webroot/img/flag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/webroot/js/script.js
Expand Up @@ -95,7 +95,7 @@
}
if(typeof returnData !== 'undefined' && returnData.flagged === true){
$('div.ajaxSubmit').find('a')
.html('Flagged <span>&#9873;</span>')
.html('Flagged <span></span>')
.removeAttr('href')
.removeClass('Flag')
.addClass('Flagged');
Expand Down

0 comments on commit d429167

Please sign in to comment.