Skip to content

Commit

Permalink
feat: allow to set options on Wrapper against issue #341
Browse files Browse the repository at this point in the history
  • Loading branch information
am-css committed Nov 15, 2021
1 parent 5abd1f1 commit 2d16d20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Dashboards/Wrappers/Wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @link http://lavacharts.com Official Docs Site
* @license http://opensource.org/licenses/MIT MIT
*/
class Wrapper implements \JsonSerializable, Jsonable, JsClass
class Wrapper extends Customizable implements \JsonSerializable, Jsonable, JsClass
{
use HasElementId;

Expand Down Expand Up @@ -50,6 +50,7 @@ public function __construct(Wrappable $itemToWrap, ElementId $elementId)
{
$this->contents = $itemToWrap;
$this->elementId = $elementId;
$this->options = array();
}

/**
Expand All @@ -69,11 +70,11 @@ public function unwrap()
*/
public function jsonSerialize()
{
return [
return array_merge($this->options, [
'options' => $this->contents,
'containerId' => (string) $this->elementId,
$this->contents->getWrapType() => $this->contents->getType()
];
]);
}

/**
Expand Down

0 comments on commit 2d16d20

Please sign in to comment.