Skip to content

Commit

Permalink
QoL change to setMode and setTheme methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Gröger committed May 30, 2023
1 parent 142a4dd commit 21f94cb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Forms/CodeEditorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public function getMode(): string
*/
public function setMode($mode): static
{
$this->mode = $mode;
if (str_contains($mode, 'ace/mode/')) {
$this->mode = $mode;
} else {
$this->mode = 'ace/mode/' . $mode;
}

return $this;
}

Expand All @@ -74,7 +79,12 @@ public function getTheme(): string
*/
public function setTheme($theme): static
{
$this->theme = $theme;
if (str_contains($theme, 'ace/theme/')) {
$this->theme = $theme;
} else {
$this->theme = 'ace/theme/' . $theme;
}

return $this;
}
}

0 comments on commit 21f94cb

Please sign in to comment.