Prevent Send on Enter in Fullscreen Remarkup Mode
Summary: Fixes T12138. Test for the presence of being in fullscreen mode, and disable send on enter if present. Side note, I'd love a first class "hasClass" type Javelin function. Test Plan: - Go to Conpherence - Type some smack, see it send on enter - Go fullscreen like a boss - Let the words flow - Close fullscreen, then send on enter. - (might be nice someday to add a "submit" button to fullscreen editor) Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12138 Differential Revision: https://secure.phabricator.com/D17590
This commit is contained in:
@@ -184,6 +184,7 @@ final class ConpherenceViewController extends
|
||||
id(new PhabricatorRemarkupControl())
|
||||
->setUser($user)
|
||||
->setName('text')
|
||||
->setSendOnEnter(true)
|
||||
->setValue($draft->getDraft()));
|
||||
|
||||
$status_view = phutil_tag(
|
||||
|
||||
@@ -5,6 +5,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
|
||||
private $disableMacro = false;
|
||||
private $disableFullScreen = false;
|
||||
private $canPin;
|
||||
private $sendOnEnter = false;
|
||||
|
||||
public function setDisableMacros($disable) {
|
||||
$this->disableMacro = $disable;
|
||||
@@ -25,6 +26,15 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
|
||||
return $this->canPin;
|
||||
}
|
||||
|
||||
public function setSendOnEnter($soe) {
|
||||
$this->sendOnEnter = $soe;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSendOnEnter() {
|
||||
return $this->sendOnEnter;
|
||||
}
|
||||
|
||||
protected function renderInput() {
|
||||
$id = $this->getID();
|
||||
if (!$id) {
|
||||
@@ -78,6 +88,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
|
||||
),
|
||||
'canPin' => $this->getCanPin(),
|
||||
'disabled' => $this->getDisabled(),
|
||||
'sendOnEnter' => $this->getSendOnEnter(),
|
||||
'rootID' => $root_id,
|
||||
'autocompleteMap' => (object)array(
|
||||
64 => array( // "@"
|
||||
|
||||
Reference in New Issue
Block a user