Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14012849
D16422.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16422.id.diff
View Options
diff --git a/src/applications/phid/view/PHUIHandleTagListView.php b/src/applications/phid/view/PHUIHandleTagListView.php
--- a/src/applications/phid/view/PHUIHandleTagListView.php
+++ b/src/applications/phid/view/PHUIHandleTagListView.php
@@ -61,15 +61,21 @@
}
}
- if ($this->limit && (count($handles) > $this->limit)) {
- if (!is_array($handles)) {
- $handles = iterator_to_array($handles);
- }
- $handles = array_slice($handles, 0, $this->limit);
+ // We may be passed a PhabricatorHandleList; if we are, convert it into
+ // a normal array.
+ if (!is_array($handles)) {
+ $handles = iterator_to_array($handles);
+ }
+
+ $over_limit = $this->limit && (count($handles) > $this->limit);
+ if ($over_limit) {
+ $visible = array_slice($handles, 0, $this->limit);
+ } else {
+ $visible = $handles;
}
$list = array();
- foreach ($handles as $handle) {
+ foreach ($visible as $handle) {
$tag = $handle->renderTag();
if ($this->showHovercards) {
$tag->setPHID($handle->getPHID());
@@ -84,21 +90,21 @@
));
}
- if ($this->limit) {
- if (count($this->handles) > $this->limit) {
- $tip_text = implode(', ', mpull($this->handles, 'getName'));
+ if ($over_limit) {
+ $tip_text = implode(', ', mpull($handles, 'getName'));
- $more = $this->newPlaceholderTag()
- ->setName("\xE2\x80\xA6")
- ->addSigil('has-tooltip')
- ->setMetadata(
- array(
- 'tip' => $tip_text,
- 'size' => 200,
- ));
+ Javelin::initBehavior('phabricator-tooltips');
- $list[] = $this->newItem($more);
- }
+ $more = $this->newPlaceholderTag()
+ ->setName("\xE2\x80\xA6")
+ ->addSigil('has-tooltip')
+ ->setMetadata(
+ array(
+ 'tip' => $tip_text,
+ 'size' => 200,
+ ));
+
+ $list[] = $this->newItem($more);
}
return $list;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 2, 8:16 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6727582
Default Alt Text
D16422.id.diff (1 KB)
Attached To
Mode
D16422: Simplify how tag lists manage their handles
Attached
Detach File
Event Timeline
Log In to Comment