diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 0d98d4596b..cc504725b9 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -1289,23 +1289,24 @@ celerity_register_resource_map(array( ), 'javelin-behavior-conpherence-menu' => array( - 'uri' => '/res/e8479b8e/rsrc/js/application/conpherence/behavior-menu.js', + 'uri' => '/res/257f200d/rsrc/js/application/conpherence/behavior-menu.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', 1 => 'javelin-dom', - 2 => 'javelin-request', - 3 => 'javelin-stratcom', - 4 => 'javelin-workflow', - 5 => 'javelin-behavior-device', - 6 => 'javelin-history', + 2 => 'javelin-util', + 3 => 'javelin-request', + 4 => 'javelin-stratcom', + 5 => 'javelin-workflow', + 6 => 'javelin-behavior-device', + 7 => 'javelin-history', ), 'disk' => '/rsrc/js/application/conpherence/behavior-menu.js', ), 'javelin-behavior-conpherence-pontificate' => array( - 'uri' => '/res/68f1e046/rsrc/js/application/conpherence/behavior-pontificate.js', + 'uri' => '/res/91d6418d/rsrc/js/application/conpherence/behavior-pontificate.js', 'type' => 'js', 'requires' => array( diff --git a/src/applications/conpherence/storage/ConpherenceParticipant.php b/src/applications/conpherence/storage/ConpherenceParticipant.php index 1dd78130f7..119d6e5cc8 100644 --- a/src/applications/conpherence/storage/ConpherenceParticipant.php +++ b/src/applications/conpherence/storage/ConpherenceParticipant.php @@ -28,7 +28,7 @@ final class ConpherenceParticipant extends ConpherenceDAO { public function markUpToDate( ConpherenceThread $conpherence, ConpherenceTransaction $xaction) { - if (!$this->isUpToDate()) { + if (!$this->isUpToDate($conpherence)) { $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); $this->setBehindTransactionPHID($xaction->getPHID()); $this->setSeenMessageCount($conpherence->getMessageCount()); @@ -37,9 +37,12 @@ final class ConpherenceParticipant extends ConpherenceDAO { return $this; } - public function isUpToDate() { - return $this->getParticipationStatus() == - ConpherenceParticipationStatus::UP_TO_DATE; + private function isUpToDate(ConpherenceThread $conpherence) { + return + ($this->getSeenMessageCount() == $conpherence->getMessageCount()) + && + ($this->getParticipationStatus() == + ConpherenceParticipationStatus::UP_TO_DATE); } } diff --git a/webroot/rsrc/js/application/conpherence/behavior-menu.js b/webroot/rsrc/js/application/conpherence/behavior-menu.js index 0c22e47201..ab2f12f000 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-menu.js +++ b/webroot/rsrc/js/application/conpherence/behavior-menu.js @@ -2,6 +2,7 @@ * @provides javelin-behavior-conpherence-menu * @requires javelin-behavior * javelin-dom + * javelin-util * javelin-request * javelin-stratcom * javelin-workflow @@ -134,29 +135,48 @@ JX.behavior('conpherence-menu', function(config) { JX.Stratcom.listen('click', 'conpherence-edit-metadata', function (e) { e.kill(); - var root = JX.$(config.form_pane); - var form = JX.DOM.find(root, 'form'); + var root = e.getNode('conpherence-layout'); + var form = JX.DOM.find(root, 'form', 'conpherence-pontificate'); var data = e.getNodeData('conpherence-edit-metadata'); + var header = JX.DOM.find(root, 'div', 'conpherence-header'); + var peopleWidget = null; + try { + peopleWidget = JX.DOM.find(root, 'div', 'widgets-people'); + } catch (ex) { + // Ignore; maybe no people widget + } + new JX.Workflow.newFromForm(form, data) - .setHandler(function (r) { + .setHandler(JX.bind(this, function(r) { // update the header JX.DOM.setContent( - JX.$(config.header), + header, JX.$H(r.header) ); - // update the menu entry - JX.DOM.replace( - JX.$(r.conpherence_phid + '-nav-item'), - JX.$H(r.nav_item) - ); + try { + // update the menu entry + JX.DOM.replace( + JX.$(r.conpherence_phid + '-nav-item'), + JX.$H(r.nav_item) + ); + JX.Stratcom.invoke( + 'conpherence-selectthread', + null, + { id : r.conpherence_phid + '-nav-item' } + ); + } catch (ex) { + // Ignore; this view may not have a menu. + } - // update the people widget - JX.DOM.setContent( - JX.$(config.people_widget), - JX.$H(r.people_widget) - ); - }) + if (peopleWidget) { + // update the people widget + JX.DOM.setContent( + peopleWidget, + JX.$H(r.people_widget) + ); + } + })) .start(); }); diff --git a/webroot/rsrc/js/application/conpherence/behavior-pontificate.js b/webroot/rsrc/js/application/conpherence/behavior-pontificate.js index 1661e5a1d1..aecf159b01 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-pontificate.js +++ b/webroot/rsrc/js/application/conpherence/behavior-pontificate.js @@ -22,6 +22,12 @@ JX.behavior('conpherence-pontificate', function(config) { } catch (ex) { // Ignore; maybe no files widget } + var peopleWidget = null; + try { + peopleWidget = JX.DOM.find(root, 'div', 'widgets-people'); + } catch (ex) { + // Ignore; maybe no peoples widget + } JX.Workflow.newFromForm(form) .setHandler(JX.bind(this, function(r) { @@ -51,6 +57,13 @@ JX.behavior('conpherence-pontificate', function(config) { ); } + if (peopleWidget) { + JX.DOM.setContent( + peopleWidget, + JX.$H(r.people_widget) + ); + } + var inputs = JX.DOM.scry(form, 'input'); for (var ii = 0; ii < inputs.length; ii++) { if (inputs[ii].name == 'latest_transaction_id') {