Skip to content

Commit

Permalink
Fixes with getting additional JS files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Demin committed Apr 25, 2016
1 parent d98eca9 commit 925a447
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions JqPlot.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ public function registerRendererJsFile($renderer)
$url = 'plugins/jqplot.' . lcfirst($name) . '.js';
}

// Additional dependencies
if ($name == 'CanvasAxisLabelRenderer' || $name == 'CanvasAxisTickRenderer') {
$additionalUrl = 'plugins/jqplot.canvasTextRenderer.js';
if (!in_array($additionalUrl, Yii::$app->assetManager->bundles[JqPlotAsset::className()]->js)) {
Yii::$app->assetManager->bundles[JqPlotAsset::className()]->js[] = $additionalUrl;
}
}

if (!in_array($url, Yii::$app->assetManager->bundles[JqPlotAsset::className()]->js)) {
Yii::$app->assetManager->bundles[JqPlotAsset::className()]->js[] = $url;
}
Expand Down
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
"name": "sizeg/yii2-jqplot",
"description": "Yii2 jqPlot widget renders charts and graphs based on jQuery Plotting Plugin",
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"php": ">=5.4.0",
"yiisoft/yii2": "*"
},
},
"autoload": {
"psr-4": {
"sizeg\\jqplot\\": ""
Expand Down

0 comments on commit 925a447

Please sign in to comment.