mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Code improvements
This commit is contained in:
parent
c43e35530e
commit
06d3dac310
13 changed files with 121 additions and 50 deletions
|
|
@ -1532,6 +1532,25 @@
|
|||
}
|
||||
};
|
||||
|
||||
Utils.appendStyles = function ($styleTag, css)
|
||||
{
|
||||
if ($styleTag && $styleTag[0])
|
||||
{
|
||||
if ($styleTag[0].styleSheet && !Utils.isUnd($styleTag[0].styleSheet.cssText))
|
||||
{
|
||||
$styleTag[0].styleSheet.cssText = css;
|
||||
}
|
||||
else
|
||||
{
|
||||
$styleTag.text(css);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Utils.__themeTimer = 0;
|
||||
Utils.__themeAjax = null;
|
||||
|
||||
|
|
@ -1583,14 +1602,9 @@
|
|||
|
||||
if (oThemeStyle && oThemeStyle[0])
|
||||
{
|
||||
oThemeStyle.attr('data-href', sUrl).attr('data-theme', aData[0]);
|
||||
if (oThemeStyle[0].styleSheet && !Utils.isUnd(oThemeStyle[0].styleSheet.cssText))
|
||||
if (Utils.appendStyles(oThemeStyle, aData[1]))
|
||||
{
|
||||
oThemeStyle[0].styleSheet.cssText = aData[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
oThemeStyle.text(aData[1]);
|
||||
oThemeStyle.attr('data-href', sUrl).attr('data-theme', aData[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue