mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-10 22:08:32 +01:00
Fix Control + Enter for Pontificate
Summary: Simplifies the Pontificate button and makes Control + Enter work again. Test Plan: Submitted the form by clicking, hitting return, hitting control+enter. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D5472
This commit is contained in:
parent
ef30820cf4
commit
c9e42fab4f
5 changed files with 9 additions and 35 deletions
|
@ -1206,7 +1206,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-pontificate' =>
|
'javelin-behavior-conpherence-pontificate' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/e5a0ce39/rsrc/js/application/conpherence/behavior-pontificate.js',
|
'uri' => '/res/a5f5b42c/rsrc/js/application/conpherence/behavior-pontificate.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -238,7 +238,6 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceParticipantQuery' => 'applications/conpherence/query/ConpherenceParticipantQuery.php',
|
'ConpherenceParticipantQuery' => 'applications/conpherence/query/ConpherenceParticipantQuery.php',
|
||||||
'ConpherenceParticipationStatus' => 'applications/conpherence/constants/ConpherenceParticipationStatus.php',
|
'ConpherenceParticipationStatus' => 'applications/conpherence/constants/ConpherenceParticipationStatus.php',
|
||||||
'ConpherencePeopleMenuEventListener' => 'applications/conpherence/events/ConpherencePeopleMenuEventListener.php',
|
'ConpherencePeopleMenuEventListener' => 'applications/conpherence/events/ConpherencePeopleMenuEventListener.php',
|
||||||
'ConpherencePontificateControl' => 'applications/conpherence/view/ConpherencePontificateControl.php',
|
|
||||||
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
|
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
|
||||||
'ConpherenceSettings' => 'applications/conpherence/constants/ConpherenceSettings.php',
|
'ConpherenceSettings' => 'applications/conpherence/constants/ConpherenceSettings.php',
|
||||||
'ConpherenceThread' => 'applications/conpherence/storage/ConpherenceThread.php',
|
'ConpherenceThread' => 'applications/conpherence/storage/ConpherenceThread.php',
|
||||||
|
@ -1948,7 +1947,6 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceParticipantQuery' => 'PhabricatorOffsetPagedQuery',
|
'ConpherenceParticipantQuery' => 'PhabricatorOffsetPagedQuery',
|
||||||
'ConpherenceParticipationStatus' => 'ConpherenceConstants',
|
'ConpherenceParticipationStatus' => 'ConpherenceConstants',
|
||||||
'ConpherencePeopleMenuEventListener' => 'PhutilEventListener',
|
'ConpherencePeopleMenuEventListener' => 'PhutilEventListener',
|
||||||
'ConpherencePontificateControl' => 'AphrontFormControl',
|
|
||||||
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
|
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
|
||||||
'ConpherenceSettings' => 'ConpherenceConstants',
|
'ConpherenceSettings' => 'ConpherenceConstants',
|
||||||
'ConpherenceThread' =>
|
'ConpherenceThread' =>
|
||||||
|
|
|
@ -82,6 +82,8 @@ final class ConpherenceViewController extends
|
||||||
->setID($form_id)
|
->setID($form_id)
|
||||||
->setAction($update_uri)
|
->setAction($update_uri)
|
||||||
->setFlexible(true)
|
->setFlexible(true)
|
||||||
|
->addSigil('conpherence-pontificate')
|
||||||
|
->setWorkflow(true)
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->addHiddenInput('action', 'message')
|
->addHiddenInput('action', 'message')
|
||||||
->addHiddenInput('latest_transaction_id', $latest_transaction_id)
|
->addHiddenInput('latest_transaction_id', $latest_transaction_id)
|
||||||
|
@ -90,8 +92,8 @@ final class ConpherenceViewController extends
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setName('text'))
|
->setName('text'))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new ConpherencePontificateControl())
|
id(new AphrontFormSubmitControl())
|
||||||
->setFormID($form_id))
|
->setValue(pht('Pontificate')))
|
||||||
->render();
|
->render();
|
||||||
|
|
||||||
$scrollbutton = javelin_tag(
|
$scrollbutton = javelin_tag(
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class ConpherencePontificateControl extends AphrontFormControl {
|
|
||||||
|
|
||||||
private $formID;
|
|
||||||
|
|
||||||
public function setFormID($form_id) {
|
|
||||||
$this->formID = $form_id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
public function getFormID() {
|
|
||||||
return $this->formID;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getCustomControlClass() {
|
|
||||||
return 'aphront-form-control-submit';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function renderInput() {
|
|
||||||
|
|
||||||
return javelin_tag(
|
|
||||||
'button',
|
|
||||||
array (
|
|
||||||
'sigil' => 'conpherence-pontificate',
|
|
||||||
),
|
|
||||||
pht('Pontificate'));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -49,6 +49,9 @@ JX.behavior('conpherence-pontificate', function(config) {
|
||||||
.start();
|
.start();
|
||||||
};
|
};
|
||||||
|
|
||||||
JX.Stratcom.listen('click', 'conpherence-pontificate', onsubmit);
|
JX.Stratcom.listen(
|
||||||
|
['submit', 'didSyntheticSubmit'],
|
||||||
|
'conpherence-pontificate',
|
||||||
|
onsubmit);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue