frio - fix image upload for prv messages

This commit is contained in:
rabuzarus 2018-04-21 14:05:40 +02:00
parent c57f0bcce6
commit 4285cd5dc7
3 changed files with 11 additions and 3 deletions

View file

@ -446,8 +446,16 @@ function justifyPhotosAjax() {
$('#photo-album-contents').justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; });
}
// Load a js script to the html head.
function loadScript(url, callback) {
// Adding the script tag to the head as suggested before
// Check if the script is already in the html head.
var oscript = $('head script[src="' + url + '"]');
// Delete the old script from head.
if (oscript.length > 0) {
oscript.remove();
}
// Adding the script tag to the head as suggested before.
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
@ -458,7 +466,7 @@ function loadScript(url, callback) {
script.onreadystatechange = callback;
script.onload = callback;
// Fire the loading
// Fire the loading.
head.appendChild(script);
}