From 59ace3acb90457de201cc9bb5d0d2bd2e856ecfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristia=CC=81n=20Feldsam?= Date: Sat, 16 Jun 2018 17:18:36 +0200 Subject: [PATCH 1/2] Added support for dropdown button menu align right MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristián Feldsam --- src/Bootstrapper/DropdownButton.php | 26 ++++++++++++++++++- .../spec/Bootstrapper/DropdownButtonSpec.php | 7 +++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Bootstrapper/DropdownButton.php b/src/Bootstrapper/DropdownButton.php index 4292ac14..c47d8860 100644 --- a/src/Bootstrapper/DropdownButton.php +++ b/src/Bootstrapper/DropdownButton.php @@ -91,6 +91,11 @@ class DropdownButton extends RenderedObject * @var bool Whether the button should drop up */ protected $dropup = false; + + /** + * @var bool Whether the menu should align right + */ + protected $alignRight = false; /** * Set the label of the button @@ -167,6 +172,18 @@ public function dropup() return $this; } + + /** + * Sets the dropdown menu align right + * + * @return $this + */ + public function alignRight() + { + $this->alignRight = true; + + return $this; + } /** * Creates a normal dropdown button @@ -323,7 +340,14 @@ public function render() $string .= ""; } - $string .= "