Skip to content

Commit

Permalink
Events bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkhill committed Apr 26, 2016
1 parent bf91f1f commit 81f860b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
- 3.0.3
- Events bugfix

- 3.0.2
- Blade template extension bug fixes
- Combining the ```customize``` method into the constructor to provide
Expand Down
12 changes: 2 additions & 10 deletions src/Charts/Chart.php
Expand Up @@ -51,13 +51,6 @@ class Chart extends JsonConfig
*/
protected $datatable;

/**
* Enabled chart events with callbacks.
*
* @var \Khill\Lavacharts\Configs\EventManager
*/
protected $events;

/**
* Default configuration options for the chart.
*
Expand Down Expand Up @@ -95,7 +88,6 @@ public function __construct(Label $chartLabel, DataTable $datatable, Options $op
{
$this->label = $chartLabel;
$this->datatable = $datatable;
$this->events = new EventManager;

$options->extend($this->chartDefaults);

Expand All @@ -121,7 +113,7 @@ public function getType()
*/
public function hasEvents()
{
return count($this->events) > 0;
return $this->options->hasValue('events');
}

/**
Expand All @@ -132,7 +124,7 @@ public function hasEvents()
*/
public function getEvents()
{
return $this->events;
return $this->options->get('events');
}

/**
Expand Down

0 comments on commit 81f860b

Please sign in to comment.