Page MenuHomePhabricator

D8974.id21292.diff
No OneTemporary

D8974.id21292.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
return array(
'names' =>
array(
- 'core.pkg.css' => '665d1122',
+ 'core.pkg.css' => '83f73666',
'core.pkg.js' => '417722ff',
'darkconsole.pkg.js' => 'ca8671ce',
'differential.pkg.css' => '8a064eb7',
@@ -49,7 +49,7 @@
'rsrc/css/application/conpherence/message-pane.css' => 'e46b612c',
'rsrc/css/application/conpherence/notification.css' => '403cf598',
'rsrc/css/application/conpherence/update.css' => '1099a660',
- 'rsrc/css/application/conpherence/widget-pane.css' => '87b12e0c',
+ 'rsrc/css/application/conpherence/widget-pane.css' => 'bf275a6c',
'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4',
'rsrc/css/application/countdown/timer.css' => '86b7b0a0',
'rsrc/css/application/diff/inline-comment-summary.css' => '3b2d1492',
@@ -115,7 +115,7 @@
'rsrc/css/font/font-source-sans-pro.css' => '91d53463',
'rsrc/css/font/phui-font-icon-base.css' => 'cd92ff25',
'rsrc/css/layout/phabricator-action-header-view.css' => 'c14dfc57',
- 'rsrc/css/layout/phabricator-action-list-view.css' => '81383e25',
+ 'rsrc/css/layout/phabricator-action-list-view.css' => 'ae272c7e',
'rsrc/css/layout/phabricator-crumbs-view.css' => '0222cbe0',
'rsrc/css/layout/phabricator-filetree-view.css' => 'a8c86ace',
'rsrc/css/layout/phabricator-hovercard-view.css' => '46a13cf0',
@@ -354,7 +354,7 @@
'rsrc/js/application/config/behavior-reorder-fields.js' => '938aed89',
'rsrc/js/application/conpherence/behavior-menu.js' => '7ee23816',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '53f6f2dd',
- 'rsrc/js/application/conpherence/behavior-widget-pane.js' => 'd8ef8659',
+ 'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90',
'rsrc/js/application/countdown/timer.js' => '889c96f3',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '4398eabb',
'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'f2441746',
@@ -483,7 +483,7 @@
'rsrc/js/phui/behavior-phui-object-box-tabs.js' => 'a3e2244e',
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
'rsrc/js/phuix/PHUIXActionView.js' => '20793977',
- 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '8d57e61c',
+ 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bc3bd59c',
'rsrc/swf/aphlict.swf' => 'abac967d',
),
'symbols' =>
@@ -509,7 +509,7 @@
'conpherence-message-pane-css' => 'e46b612c',
'conpherence-notification-css' => '403cf598',
'conpherence-update-css' => '1099a660',
- 'conpherence-widget-pane-css' => '87b12e0c',
+ 'conpherence-widget-pane-css' => 'bf275a6c',
'differential-changeset-view-css' => '1570a1ff',
'differential-core-view-css' => '7ac3cabc',
'differential-inline-comment-editor' => 'f2441746',
@@ -547,7 +547,7 @@
'javelin-behavior-config-reorder-fields' => '938aed89',
'javelin-behavior-conpherence-menu' => '7ee23816',
'javelin-behavior-conpherence-pontificate' => '53f6f2dd',
- 'javelin-behavior-conpherence-widget-pane' => 'd8ef8659',
+ 'javelin-behavior-conpherence-widget-pane' => '40b1ff90',
'javelin-behavior-countdown-timer' => '889c96f3',
'javelin-behavior-dark-console' => 'e9fdb5e5',
'javelin-behavior-dashboard-async-panel' => '4398eabb',
@@ -684,7 +684,7 @@
'path-typeahead' => 'f7fc67ec',
'people-profile-css' => 'ba7b2762',
'phabricator-action-header-view-css' => 'c14dfc57',
- 'phabricator-action-list-view-css' => '81383e25',
+ 'phabricator-action-list-view-css' => 'ae272c7e',
'phabricator-application-launch-view-css' => 'd290ba21',
'phabricator-busy' => '6453c869',
'phabricator-chatlog-css' => '852140ff',
@@ -777,7 +777,7 @@
'phui-workpanel-view-css' => '97b69459',
'phuix-action-list-view' => 'b5c256b8',
'phuix-action-view' => '20793977',
- 'phuix-dropdown-menu' => '8d57e61c',
+ 'phuix-dropdown-menu' => 'bc3bd59c',
'policy-css' => '957ea14c',
'policy-edit-css' => '05cca26a',
'policy-transaction-detail-css' => '82100a43',
@@ -1081,6 +1081,19 @@
1 => 'javelin-dom',
2 => 'phortune-credit-card-form',
),
+ '40b1ff90' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-dom',
+ 2 => 'javelin-stratcom',
+ 3 => 'javelin-workflow',
+ 4 => 'javelin-util',
+ 5 => 'phabricator-notification',
+ 6 => 'javelin-behavior-device',
+ 7 => 'phuix-dropdown-menu',
+ 8 => 'phuix-action-list-view',
+ 9 => 'phuix-action-view',
+ ),
'4398eabb' =>
array(
0 => 'javelin-behavior',
@@ -1204,6 +1217,11 @@
2 => 'javelin-util',
3 => 'phabricator-shaped-request',
),
+ '7319e029' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-dom',
+ ),
'62e18640' =>
array(
0 => 'javelin-install',
@@ -1239,11 +1257,6 @@
1 => 'javelin-stratcom',
2 => 'javelin-dom',
),
- '7319e029' =>
- array(
- 0 => 'javelin-behavior',
- 1 => 'javelin-dom',
- ),
'75903ee1' =>
array(
0 => 'javelin-behavior',
@@ -1374,14 +1387,6 @@
2 => 'javelin-stratcom',
3 => 'javelin-uri',
),
- '8d57e61c' =>
- array(
- 0 => 'javelin-install',
- 1 => 'javelin-util',
- 2 => 'javelin-dom',
- 3 => 'javelin-vector',
- 4 => 'javelin-stratcom',
- ),
'8ef9ab58' =>
array(
0 => 'javelin-behavior',
@@ -1615,6 +1620,14 @@
0 => 'javelin-install',
1 => 'javelin-dom',
),
+ 'bc3bd59c' =>
+ array(
+ 0 => 'javelin-install',
+ 1 => 'javelin-util',
+ 2 => 'javelin-dom',
+ 3 => 'javelin-vector',
+ 4 => 'javelin-stratcom',
+ ),
'bc778103' =>
array(
0 => 'javelin-behavior',
@@ -1798,18 +1811,6 @@
4 => 'javelin-workflow',
5 => 'phabricator-draggable-list',
),
- 'd8ef8659' =>
- array(
- 0 => 'javelin-behavior',
- 1 => 'javelin-dom',
- 2 => 'javelin-stratcom',
- 3 => 'javelin-workflow',
- 4 => 'javelin-util',
- 5 => 'phabricator-notification',
- 6 => 'javelin-behavior-device',
- 7 => 'phabricator-dropdown-menu',
- 8 => 'phabricator-menu-item',
- ),
'd9a9b862' =>
array(
0 => 'javelin-install',
diff --git a/src/applications/conpherence/view/ConpherenceLayoutView.php b/src/applications/conpherence/view/ConpherenceLayoutView.php
--- a/src/applications/conpherence/view/ConpherenceLayoutView.php
+++ b/src/applications/conpherence/view/ConpherenceLayoutView.php
@@ -81,11 +81,13 @@
'widgetRegistry' => array(
'conpherence-message-pane' => array(
'name' => pht('Thread'),
+ 'icon' => 'comment',
'deviceOnly' => true,
'hasCreate' => false
),
'widgets-people' => array(
'name' => pht('Participants'),
+ 'icon' => 'user',
'deviceOnly' => false,
'hasCreate' => true,
'createData' => array(
@@ -96,11 +98,13 @@
),
'widgets-files' => array(
'name' => pht('Files'),
+ 'icon' => 'file',
'deviceOnly' => false,
'hasCreate' => false
),
'widgets-calendar' => array(
'name' => pht('Calendar'),
+ 'icon' => 'calendar',
'deviceOnly' => false,
'hasCreate' => true,
'createData' => array(
@@ -111,6 +115,7 @@
),
'widgets-settings' => array(
'name' => pht('Settings'),
+ 'icon' => 'wrench',
'deviceOnly' => false,
'hasCreate' => false
),
diff --git a/webroot/rsrc/css/application/conpherence/widget-pane.css b/webroot/rsrc/css/application/conpherence/widget-pane.css
--- a/webroot/rsrc/css/application/conpherence/widget-pane.css
+++ b/webroot/rsrc/css/application/conpherence/widget-pane.css
@@ -62,11 +62,6 @@
display: none;
}
-.dropdown-menu-frame {
- width: 200px !important;
- margin-top: 4px;
-}
-
.conpherence-widget-pane .widgets-body {
position: fixed;
overflow-y: auto;
diff --git a/webroot/rsrc/css/layout/phabricator-action-list-view.css b/webroot/rsrc/css/layout/phabricator-action-list-view.css
--- a/webroot/rsrc/css/layout/phabricator-action-list-view.css
+++ b/webroot/rsrc/css/layout/phabricator-action-list-view.css
@@ -11,6 +11,12 @@
display: none;
}
+.device .phuix-dropdown-menu .phabricator-action-list-view {
+ /* When an action list view appears inside a dropdown menu, don't hide it
+ by default. */
+ display: block;
+}
+
.device .phabricator-action-list-view.phabricator-action-list-toggle {
display: block;
}
diff --git a/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js b/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js
--- a/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js
+++ b/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js
@@ -6,8 +6,9 @@
* javelin-util
* phabricator-notification
* javelin-behavior-device
- * phabricator-dropdown-menu
- * phabricator-menu-item
+ * phuix-dropdown-menu
+ * phuix-action-list-view
+ * phuix-action-view
* @provides javelin-behavior-conpherence-widget-pane
*/
@@ -37,7 +38,7 @@
return;
}
JX.DOM.show(device_header);
- var device_menu = new JX.PhabricatorDropdownMenu(device_header);
+ var device_menu = new JX.PHUIXDropdownMenu(device_header);
data.deviceMenu = true;
_buildWidgetSelector(device_menu, data);
};
@@ -51,8 +52,12 @@
var root = JX.DOM.find(document, 'div', 'conpherence-layout');
var widget_pane = JX.DOM.find(root, 'div', 'conpherence-widget-pane');
var widget_header = JX.DOM.find(widget_pane, 'a', 'widgets-selector');
- var menu = new JX.PhabricatorDropdownMenu(widget_header);
- menu.toggleAlignDropdownRight(false);
+
+ var menu = new JX.PHUIXDropdownMenu(widget_header);
+ menu
+ .setAlign('left')
+ .setOffsetY(4);
+
data.deviceMenu = false;
_buildWidgetSelector(menu, data);
};
@@ -64,32 +69,40 @@
*/
var _buildWidgetSelector = function (menu, data) {
_loadedWidgetsID = data.threadID;
+
+ var list = new JX.PHUIXActionListView();
+ var map = {};
+
var widgets = config.widgetRegistry;
for (var widget in widgets) {
var widget_data = widgets[widget];
if (widget_data.deviceOnly && data.deviceMenu === false) {
continue;
}
- menu.addItem(new JX.PhabricatorMenuItem(
- widget_data.name,
- JX.bind(null, toggleWidget, { widget : widget }),
- '#'
- ).setDisabled(widget == data.widget));
+
+ var item = new JX.PHUIXActionView()
+ .setIcon(widget_data.icon || 'none')
+ .setName(widget_data.name)
+ .setHandler(
+ JX.bind(null, function(widget, e) {
+ toggleWidget({widget: widget});
+ e.prevent();
+ menu.close();
+ }, widget));
+
+ map[widget_data.name] = item;
+ list.addItem(item);
}
- menu.listen(
- 'open',
- JX.bind(menu, function () {
- for (var ii = 0; ii < this._items.length; ii++) {
- var item = this._items[ii];
- var name = item.getName();
- if (name == _selectedWidgetName) {
- item.setDisabled(true);
- } else {
- item.setDisabled(false);
- }
- }
- }));
+ menu
+ .setWidth(200)
+ .setContent(list.getNode());
+
+ menu.listen('open', function() {
+ for (var k in map) {
+ map[k].setDisabled((k == _selectedWidgetName));
+ }
+ });
};
/**
diff --git a/webroot/rsrc/js/phuix/PHUIXDropdownMenu.js b/webroot/rsrc/js/phuix/PHUIXDropdownMenu.js
--- a/webroot/rsrc/js/phuix/PHUIXDropdownMenu.js
+++ b/webroot/rsrc/js/phuix/PHUIXDropdownMenu.js
@@ -44,7 +44,9 @@
properties: {
width: null,
- align: 'right'
+ align: 'right',
+ offsetX: 0,
+ offsetY: 0
},
members: {
@@ -171,6 +173,8 @@
break;
}
+ v = v.add(this.getOffsetX(), this.getOffsetY());
+
v.setPos(this._menu);
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 6, 1:45 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7734526
Default Alt Text
D8974.id21292.diff (12 KB)

Event Timeline