Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffInlineCommentRowScaffold.php
Show All 15 Lines | abstract class PHUIDiffInlineCommentRowScaffold extends AphrontView { | ||||
} | } | ||||
public function addInlineView(PHUIDiffInlineCommentView $view) { | public function addInlineView(PHUIDiffInlineCommentView $view) { | ||||
$this->views[] = $view; | $this->views[] = $view; | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function getRowAttributes() { | protected function getRowAttributes() { | ||||
// TODO: This is semantic information used by the JS when placing comments | $is_hidden = false; | ||||
// and using keyboard navigation; we should move it out of class names. | |||||
$style = null; | |||||
foreach ($this->getInlineViews() as $view) { | foreach ($this->getInlineViews() as $view) { | ||||
if ($view->isHidden()) { | if ($view->isHidden()) { | ||||
$style = 'display: none'; | $is_hidden = true; | ||||
} | |||||
} | } | ||||
$classes = array(); | |||||
$classes[] = 'inline'; | |||||
if ($is_hidden) { | |||||
$classes[] = 'inline-hidden'; | |||||
} | } | ||||
return array( | $result = array( | ||||
'class' => 'inline', | 'class' => implode(' ', $classes), | ||||
'sigil' => 'inline-row', | 'sigil' => 'inline-row', | ||||
'style' => $style, | 'meta' => array( | ||||
'hidden' => $is_hidden, | |||||
), | |||||
); | ); | ||||
return $result; | |||||
} | } | ||||
} | } |