diff --git a/src/applications/directory/controller/PhabricatorDirectoryController.php b/src/applications/directory/controller/PhabricatorDirectoryController.php index 1ee343e4b9..bdf85b43db 100644 --- a/src/applications/directory/controller/PhabricatorDirectoryController.php +++ b/src/applications/directory/controller/PhabricatorDirectoryController.php @@ -125,9 +125,8 @@ abstract class PhabricatorDirectoryController extends PhabricatorController { if ($is_hide) { $label_id = celerity_generate_unique_node_id(); $attrs = array(); - $attrs['style'] = 'display: none;'; - $attrs['id'] = $label_id; - $label->setContainerAttrs($attrs); + $label->setStyle('display: none;'); + $label->setID($label_id); $tile_ids[] = $label_id; } diff --git a/src/view/AphrontTagView.php b/src/view/AphrontTagView.php index 3690e02675..55b93efcbd 100644 --- a/src/view/AphrontTagView.php +++ b/src/view/AphrontTagView.php @@ -89,10 +89,6 @@ abstract class AphrontTagView extends AphrontView { return $this->renderChildren(); } - protected function renderTagContainer($tag) { - return $tag; - } - protected function willRender() { return; } @@ -126,8 +122,7 @@ abstract class AphrontTagView extends AphrontView { $tag_view_attributes = array( 'id' => $this->id, - 'class' => $this->classes ? - implode(' ', array_filter($this->classes)) : null, + 'class' => implode(' ', $this->classes), 'style' => $this->style, 'meta' => $this->metadata, @@ -155,11 +150,9 @@ abstract class AphrontTagView extends AphrontView { } } - $tag = javelin_tag( + return javelin_tag( $this->getTagName(), $attributes, $this->getTagContent()); - - return $this->renderTagContainer($tag); } } diff --git a/src/view/phui/PHUIListItemView.php b/src/view/phui/PHUIListItemView.php index 7b4fb59ae5..df24a426ae 100644 --- a/src/view/phui/PHUIListItemView.php +++ b/src/view/phui/PHUIListItemView.php @@ -19,15 +19,6 @@ final class PHUIListItemView extends AphrontTagView { private $selected; private $containerAttrs; - public function setProperty($property) { - $this->property = $property; - return $this; - } - - public function getProperty() { - return $this->property; - } - public function setSelected($selected) { $this->selected = $selected; return $this; @@ -91,34 +82,26 @@ final class PHUIListItemView extends AphrontTagView { return $this->isExternal; } - // Maybe should be add ? - public function setContainerAttrs($attrs) { - $this->containerAttrs = $attrs; - return $this; - } - protected function getTagName() { - return $this->href ? 'a' : 'div'; - } - - protected function renderTagContainer($tag) { - $classes = array( - 'phui-list-item-view', - 'phui-list-item-'.$this->type, - $this->icon ? 'phui-list-item-has-icon' : null, - $this->selected ? 'phui-list-item-selected' : null - ); - - // This is derptastical - $this->containerAttrs['class'] = implode(' ', array_filter($classes)); - - return phutil_tag('li', $this->containerAttrs, $tag); + return 'li'; } protected function getTagAttributes() { + $classes = array(); + $classes[] = 'phui-list-item-view'; + $classes[] = 'phui-list-item-'.$this->type; + + if ($this->icon) { + $classes[] = 'phui-list-item-has-icon'; + } + + if ($this->selected) { + $classes[] = 'phui-list-item-selected'; + } + return array( - 'class' => $this->href ? 'phui-list-item-href' : '', - 'href' => $this->href); + 'class' => $classes, + ); } protected function getTagContent() { @@ -149,11 +132,17 @@ final class PHUIListItemView extends AphrontTagView { ->setSpriteIcon($this->icon); } - return array( - $icon, - $this->renderChildren(), - $name, - ); + return phutil_tag( + $this->href ? 'a' : 'div', + array( + 'href' => $this->href, + 'class' => $this->href ? 'phui-list-item-href' : null, + ), + array( + $icon, + $this->renderChildren(), + $name, + )); } } diff --git a/webroot/rsrc/js/application/maniphest/behavior-list-edit.js b/webroot/rsrc/js/application/maniphest/behavior-list-edit.js index 873b9d8aee..f5128289c6 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-list-edit.js +++ b/webroot/rsrc/js/application/maniphest/behavior-list-edit.js @@ -18,12 +18,15 @@ JX.behavior('maniphest-list-editor', function(config) { new JX.FX(new_task).setDuration(500).start({opacity: [0, 1]}); }; - JX.Stratcom.listen('click', 'maniphest-edit-task', function(e) { - e.kill(); - var task = e.getNode('maniphest-task'); - JX.Workflow.newFromLink(e.getNode('maniphest-edit-task')) - .setHandler(JX.bind(null, onedit, task)) - .start(); + JX.Stratcom.listen( + 'click', + ['maniphest-edit-task', 'tag:a'], + function(e) { + e.kill(); + var task = e.getNode('maniphest-task'); + JX.Workflow.newFromLink(e.getNode('tag:a')) + .setHandler(JX.bind(null, onedit, task)) + .start(); }); }); diff --git a/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js b/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js index 68abcc6fad..3e5a77a100 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js +++ b/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js @@ -30,7 +30,7 @@ JX.behavior('maniphest-subpriority-editor', function(config) { }); draggable.listen('shouldBeginDrag', function(e) { - if (e.getNode('slippery')) { + if (e.getNode('slippery') || e.getNode('maniphest-edit-task')) { JX.Stratcom.context().kill(); } });