mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-05 03:18:25 +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' =>
|
||||
array(
|
||||
'uri' => '/res/e5a0ce39/rsrc/js/application/conpherence/behavior-pontificate.js',
|
||||
'uri' => '/res/a5f5b42c/rsrc/js/application/conpherence/behavior-pontificate.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -238,7 +238,6 @@ phutil_register_library_map(array(
|
|||
'ConpherenceParticipantQuery' => 'applications/conpherence/query/ConpherenceParticipantQuery.php',
|
||||
'ConpherenceParticipationStatus' => 'applications/conpherence/constants/ConpherenceParticipationStatus.php',
|
||||
'ConpherencePeopleMenuEventListener' => 'applications/conpherence/events/ConpherencePeopleMenuEventListener.php',
|
||||
'ConpherencePontificateControl' => 'applications/conpherence/view/ConpherencePontificateControl.php',
|
||||
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
|
||||
'ConpherenceSettings' => 'applications/conpherence/constants/ConpherenceSettings.php',
|
||||
'ConpherenceThread' => 'applications/conpherence/storage/ConpherenceThread.php',
|
||||
|
@ -1948,7 +1947,6 @@ phutil_register_library_map(array(
|
|||
'ConpherenceParticipantQuery' => 'PhabricatorOffsetPagedQuery',
|
||||
'ConpherenceParticipationStatus' => 'ConpherenceConstants',
|
||||
'ConpherencePeopleMenuEventListener' => 'PhutilEventListener',
|
||||
'ConpherencePontificateControl' => 'AphrontFormControl',
|
||||
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
|
||||
'ConpherenceSettings' => 'ConpherenceConstants',
|
||||
'ConpherenceThread' =>
|
||||
|
|
|
@ -82,6 +82,8 @@ final class ConpherenceViewController extends
|
|||
->setID($form_id)
|
||||
->setAction($update_uri)
|
||||
->setFlexible(true)
|
||||
->addSigil('conpherence-pontificate')
|
||||
->setWorkflow(true)
|
||||
->setUser($user)
|
||||
->addHiddenInput('action', 'message')
|
||||
->addHiddenInput('latest_transaction_id', $latest_transaction_id)
|
||||
|
@ -90,8 +92,8 @@ final class ConpherenceViewController extends
|
|||
->setUser($user)
|
||||
->setName('text'))
|
||||
->appendChild(
|
||||
id(new ConpherencePontificateControl())
|
||||
->setFormID($form_id))
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue(pht('Pontificate')))
|
||||
->render();
|
||||
|
||||
$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();
|
||||
};
|
||||
|
||||
JX.Stratcom.listen('click', 'conpherence-pontificate', onsubmit);
|
||||
JX.Stratcom.listen(
|
||||
['submit', 'didSyntheticSubmit'],
|
||||
'conpherence-pontificate',
|
||||
onsubmit);
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue