Hi there,
Again, this seems to be horribly simple, but I can’t figure it out.
I have file called mytooltip.js, placed in protected/scripts/mytooltip/ and published via:
//Include tooltip script
$assets = Yii:app()->basePath.'/scripts/mytooltip';
$url = Yii::app()->getAssetManager()->publish($assets);
Yii::app()->clientScript->registerCssFile($url.'/mytooltip.css');
Yii::app()->clientScript->registerScriptFile($url.'/mytooltip.js');
Inside mytooltip.js I have such piece of code:
var mySettings=
{
userTooltipOffset: [11, 11], //Additional x/y margin between objectand mouse cursor.
loadingHTML: '<div><img src="mytooltip.gif" width="30" height="30" alt="Loading">Loading...</div>',
}
How can I set/change path to image in img tag inside this script after it’s publication? How can I make it visible by passing valid path in any possible way?
Using this JS script was piece of cake when including in static HTML page. All files (mytooltip.html, mytooltip.js, mytooltip.css and mytooltip.gif) were in the same folder, so there was no need to pass any path.
But after moving this script to Yii and assetsManager approach, this became real pain in the ass (at least for me).
Cheers,
Trejder