Skip to content

Commit

Permalink
fix load siteUrl variable in javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Mar 2, 2021
1 parent f82176c commit 3220446
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fields/radicalmultifield.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function getInput()
$this->formsource = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><form>";

//подзагружаем кастомные поля
Factory::getDocument()->addScriptDeclaration("let siteUrl = '". Uri::root(). "'");
Factory::getDocument()->addScriptDeclaration("window.siteUrl = '". Uri::root() . "'");
JLoader::register('RadicalmultifieldHelper', JPATH_ROOT . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['plugins', 'fields', 'radicalmultifield', 'radicalmultifieldhelper']) . '.php');

if(isset($params['extendfield']) && !empty($params['extendfield']))
Expand Down
4 changes: 2 additions & 2 deletions media/js/subform-repetable-cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jQuery(document).ready(function(){
let image = val;

if(image.charAt(0) !== '/') {
image = siteUrl + image;
image = window.siteUrl + image;
}

tile.find('.subform-card-tile-background').css('background-image', 'url(' + image + ')');
Expand Down Expand Up @@ -83,7 +83,7 @@ jQuery(document).ready(function(){
let image = inputImage.val();

if(image.charAt(0) !== '/') {
image = siteUrl + image;
image = window.siteUrl + image;
}

tile.find('.subform-card-tile-background').css('background-image', 'url(' + image + ')');
Expand Down
2 changes: 1 addition & 1 deletion radicalmultifield.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<authorUrl>https://delo-design.ru</authorUrl>
<copyright>Copyright (C) 2018 "Delo Design". All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<version>3.0.1</version>
<version>3.0.2</version>
<description>PLG_RADICAL_MULTI_FIELD_XML_DESCRIPTION</description>

<scriptfile>script.php</scriptfile>
Expand Down

0 comments on commit 3220446

Please sign in to comment.