mirror of
https://github.com/Mowie/Mowie
synced 2024-06-12 13:49:38 +00:00
Fixed Loading of extra CSS
This commit is contained in:
parent
1cbe09099a
commit
a151256905
|
@ -57,19 +57,6 @@ if (!isset($_GET['direct']))
|
|||
})
|
||||
}
|
||||
|
||||
//Add CSS
|
||||
function addcss(css){
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var s = document.createElement('style');
|
||||
s.setAttribute('type', 'text/css');
|
||||
if (s.styleSheet) { // IE
|
||||
s.styleSheet.cssText = css;
|
||||
} else { // the world
|
||||
s.appendChild(document.createTextNode(css));
|
||||
}
|
||||
head.appendChild(s);
|
||||
}
|
||||
|
||||
//showStream
|
||||
function showStream()
|
||||
{
|
||||
|
@ -191,11 +178,12 @@ if (!isset($_GET['direct']))
|
|||
}
|
||||
|
||||
//Get CSS
|
||||
$('#addedCss').remove(); // Remove old CSS
|
||||
$.get(ctx.pathname + '?css' + query, function (data) {
|
||||
if(data.css) {
|
||||
for(var i = 0; i < data.css_files.length; i++) {
|
||||
var cssFile = data.css_files[i];
|
||||
addcss(cssFile);
|
||||
$('head').append('<link rel="stylesheet" href="' + data.fullUri + cssFile + '" type="text/css" id="addedCss">');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -232,7 +232,7 @@ function printHeader($title)
|
|||
$appInfo = $GLOBALS['apps']->getApp($app);
|
||||
if(isset($appInfo['css']))
|
||||
{
|
||||
echo json_encode(['css' => true, 'css_files' => $appInfo['css']]);
|
||||
echo json_encode(['css' => true, 'css_files' => $appInfo['css'], 'fullUri' => $GLOBALS['MCONF']['web_uri'].'apps/'.$app.'/']);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user