Remove duplicate inline scaffold in 2up renderer

Summary: Ref T2009. Remove the 4 (!!) copies of this code.

Test Plan:
  - Added, edited, and removed inline comments in 2up view.
  - Stacked a bunch of comments on the same line and saw the JS place them correctly.
  - Created an image diff and added, edited and removed inlines on it.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D12000
This commit is contained in:
epriestley
2015-03-06 05:57:24 -08:00
parent ac60b23ef9
commit f9cb366f00
5 changed files with 34 additions and 48 deletions

View File

@@ -20,4 +20,12 @@ abstract class PHUIDiffInlineCommentRowScaffold extends AphrontView {
return $this;
}
protected function getRowAttributes() {
// TODO: This is semantic information used by the JS when placing comments
// and using keyboard navigation; we should move it out of class names.
return array(
'class' => 'inline',
);
}
}

View File

@@ -27,7 +27,7 @@ final class PHUIDiffOneUpInlineCommentRowScaffold
phutil_tag('td', $attrs, $inline),
);
return phutil_tag('tr', array(), $cells);
return phutil_tag('tr', $this->getRowAttributes(), $cells);
}
}

View File

@@ -66,7 +66,7 @@ final class PHUIDiffTwoUpInlineCommentRowScaffold
phutil_tag('td', $right_attrs, $right_side),
);
return phutil_tag('tr', array(), $cells);
return phutil_tag('tr', $this->getRowAttributes(), $cells);
}
}