HTML and CSS Reference
In-Depth Information
-moz-transition: opacity 1s ease-in-out;
-ms-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
#questions.closed,#questions li.answered { opacity: .4; }
#questions.closed .vote,#questions .answered .vote { opacity: .2; }
These styles prevent the button from highlighting when hovered, as well as preventing the mouse cursor from
turning into a pointer, which is a standard indication that an element is clickable.
The transition effects are in place to create an animated fade when questions are voted or answered. In order
to trigger a CSS transition in this case, the element needs to have a class added, so keep in mind that the transitions
won't be visible until we implement realtime and jQuery effects in the next chapter.
Loading All Questions for the Room
The last piece of the output_view() method is the currently nonexistent method get_questions() . The actual
database query will be added to the question model a little later in this chapter, but for now, let's declare the method
in the controller.
Add the following bold code to the Question class:
public function output_ask_form( $is_active, $email )
{
if ($is_active) {
$view = new View('ask-form');
$view->room_id = $this->room_id;
$view->form_action = APP_URI . 'question/ask';
$view->nonce = $this->generate_nonce();
return $view->render(FALSE);
} else {
$view = new View('room-closed');
$view->email = $email;
return $view->render(FALSE);
}
}
/**
* Loads questions for the room
*
* @return array The question data as an array of objects
*/
protected function get_questions( )
{
return $this->model->get_room_questions($this->room_id);
}
 
Search WWH ::




Custom Search