Commit b1998a8f authored by Tobias Munk's avatar Tobias Munk

fixed PJAX URL

parent 96f75c9b
......@@ -39,7 +39,9 @@ use yii\helpers\Html;
?>
<?php $js = <<<JS
<?php
$language = Yii::$app->language;
$js = <<<JS
var lastTemplateId = '{$model->widget_template_id}';
var widgets = {
'updateTemplate': function(elem){
......@@ -47,7 +49,7 @@ var widgets = {
console.log($(elem).val());
if (!lastTemplateId || confirm('Reset values and update template?')) {
lastTemplateId = $(elem).val();
url = '/widgets/crud/widget/create?Widget[widget_template_id]='+$('#widgetcontent-widget_template_id').val();
url = '/{$language}/widgets/crud/widget/create?Widget[widget_template_id]='+$('#widgetcontent-widget_template_id').val();
//alert(url);
$.pjax.reload({url: url, container: '#pjax-widget-form'});
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment