Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14040882
D8977.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D8977.diff
View Options
diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php
--- a/resources/celerity/packages.php
+++ b/resources/celerity/packages.php
@@ -33,8 +33,9 @@
'javelin-behavior-refresh-csrf',
'javelin-behavior-phabricator-watch-anchor',
'javelin-behavior-phabricator-autofocus',
- 'phabricator-menu-item',
- 'phabricator-dropdown-menu',
+ 'phuix-dropdown-menu',
+ 'phuix-action-list-view',
+ 'phuix-action-view',
'phabricator-phtize',
'javelin-behavior-phabricator-oncopy',
'phabricator-tooltip',
diff --git a/webroot/rsrc/css/core/z-index.css b/webroot/rsrc/css/core/z-index.css
--- a/webroot/rsrc/css/core/z-index.css
+++ b/webroot/rsrc/css/core/z-index.css
@@ -133,7 +133,6 @@
z-index: 20;
}
-.dropdown-menu-frame,
.phuix-dropdown-menu {
z-index: 32;
}
diff --git a/webroot/rsrc/css/phui/phui-button.css b/webroot/rsrc/css/phui/phui-button.css
--- a/webroot/rsrc/css/phui/phui-button.css
+++ b/webroot/rsrc/css/phui/phui-button.css
@@ -166,7 +166,6 @@
text-decoration: underline;
}
-.dropdown-menu-frame,
.phuix-dropdown-menu {
position: absolute;
width: 240px;
@@ -178,25 +177,6 @@
border-bottom-color: {$greyborder};
}
-.dropdown-menu-frame .dropdown-menu-item {
- display: block;
- padding: 2px 10px;
- clear: both;
- line-height: 20px;
- color: {$darkgreytext};
- white-space: nowrap;
-}
-
-.dropdown-menu-frame .dropdown-menu-item-disabled {
- color: {$lightgreytext};
-}
-
-.dropdown-menu-frame .phui-icon-view {
- display: inline-block;
- padding: 0;
- margin: 2px 6px -2px 4px;
-}
-
a.policy-control {
width: 240px;
text-align: left;
@@ -213,17 +193,6 @@
left: 7px;
}
-.dropdown-menu-frame .dropdown-menu-item-selected {
- background: {$lightblue};
-}
-
-.dropdown-menu-frame a:hover {
- background: {$blue};
- color: white;
- cursor: pointer;
- text-decoration: none;
-}
-
a.toggle {
display: inline-block;
padding: 4px 8px;
diff --git a/webroot/rsrc/js/core/DropdownMenu.js b/webroot/rsrc/js/core/DropdownMenu.js
deleted file mode 100644
--- a/webroot/rsrc/js/core/DropdownMenu.js
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * @requires javelin-install
- * javelin-util
- * javelin-dom
- * javelin-vector
- * javelin-stratcom
- * phabricator-menu-item
- * @provides phabricator-dropdown-menu
- * @javelin
- */
-
-JX.install('PhabricatorDropdownMenu', {
-
- construct : function(node) {
- this._node = node;
- this._items = [];
- this._menu = JX.$N('div', { className : 'dropdown-menu-frame' });
-
- JX.DOM.listen(
- this._node,
- 'click',
- null,
- JX.bind(this, this._onclick));
-
- JX.DOM.listen(
- this._menu,
- 'click',
- null,
- JX.bind(this, this._onclickitem));
-
- JX.Stratcom.listen(
- 'mousedown',
- null,
- JX.bind(this, this._onclickglobal));
-
- JX.Stratcom.listen(
- 'resize',
- null,
- JX.bind(this, this._onresize));
-
- JX.PhabricatorDropdownMenu.listen(
- 'open',
- JX.bind(this, this.close));
- },
-
- events : ['open'],
-
- properties : {
- width : null
- },
-
- members : {
- _node : null,
- _menu : null,
- _open : false,
- _items : null,
- _alignRight : true,
-
- // By default, the dropdown will have its right edge aligned with the
- // right edge of _node. Making this false does left edge alignment
- toggleAlignDropdownRight : function (bool) {
- this._alignRight = bool;
- },
-
- open : function() {
- if (this._open) {
- return;
- }
-
- this.invoke('open');
-
- var menu_items = [];
- for (var ii = 0; ii < this._items.length; ii++) {
- menu_items.push(this._items[ii].render());
- }
- JX.DOM.setContent(this._menu, menu_items);
-
- this._open = true;
- this._show();
-
- return this;
- },
-
- close : function() {
- if (!this._open) {
- return;
- }
- this._open = false;
- this._hide();
-
- return this;
- },
-
- clear : function() {
- this._items = [];
- return this;
- },
-
- addItem : function(item) {
- if (__DEV__) {
- if (!(item instanceof JX.PhabricatorMenuItem)) {
- JX.$E(
- 'JX.DropdownMenu.addItem(<junk>): ' +
- 'item must be a JX.PhabricatorMenuItem.');
- }
- }
- this._items.push(item);
- return this;
- },
-
- _onclick : function(e) {
- if (this._open) {
- this.close();
- } else {
- this.open();
- }
- e.prevent();
- },
-
- _onclickitem : function(e) {
- var item = JX.Stratcom.getData(e.getTarget()).item;
- if (!item) {
- return;
- }
-
- if (item.getDisabled()) {
- e.prevent();
- return;
- }
-
- item.select();
- e.prevent();
- this.close();
- },
-
- _onclickglobal : function(e) {
- if (!this._open) {
- return;
- }
-
- if (JX.Stratcom.pass(e)) {
- return;
- }
-
- var t = e.getTarget();
- while (t) {
- if (t == this._menu || t == this._node) {
- return;
- }
- t = t.parentNode;
- }
-
- this.close();
- },
-
- _show : function() {
- document.body.appendChild(this._menu);
-
- if (this.getWidth()) {
- new JX.Vector(this.getWidth(), null).setDim(this._menu);
- }
-
- this._onresize();
-
- JX.DOM.alterClass(this._node, 'dropdown-open', true);
- },
-
- _onresize : function() {
- if (!this._open) {
- return;
- }
-
- var m = JX.Vector.getDim(this._menu);
-
- var v = JX.$V(this._node);
- var d = JX.Vector.getDim(this._node);
- if (this._alignRight) {
- v = v.add(d)
- .add(JX.$V(-m.x, 0));
- } else {
- v = v.add(0, d.y);
- }
- v.setPos(this._menu);
- },
-
- _hide : function() {
- JX.DOM.remove(this._menu);
- JX.DOM.alterClass(this._node, 'dropdown-open', false);
- }
-
- }
-});
diff --git a/webroot/rsrc/js/core/DropdownMenuItem.js b/webroot/rsrc/js/core/DropdownMenuItem.js
deleted file mode 100644
--- a/webroot/rsrc/js/core/DropdownMenuItem.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @requires javelin-install
- * javelin-dom
- * @provides phabricator-menu-item
- * @javelin
- */
-
-JX.install('PhabricatorMenuItem', {
-
- construct : function(name, action, href) {
- this.setName(name);
- this.setHref(href || '#');
- this._action = action;
- },
-
- members : {
- _action : null,
-
- render : function() {
- var classes = [];
- classes.push('dropdown-menu-item');
-
- if (this.getSelected()) {
- classes.push('dropdown-menu-item-selected');
- }
-
- if (this.getDisabled()) {
- classes.push('dropdown-menu-item-disabled');
- }
-
- var attrs = {
- href: this.getHref(),
- meta: { item: this },
- className: classes.join(' ')
- };
-
- if (this.getDisabled()) {
- return JX.$N('span', attrs, this.getName());
- } else {
- return JX.$N('a', attrs, this.getName());
- }
- },
-
- select : function() {
- this._action();
- }
- },
-
- properties : {
- name: '',
- href: '',
- disabled: false,
- selected: false
- }
-
-});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 12, 1:56 PM (6 d, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6746777
Default Alt Text
D8977.diff (7 KB)
Attached To
Mode
D8977: Delete all old dropdown menu code
Attached
Detach File
Event Timeline
Log In to Comment