Merge branch 'bugfix/ie8-fixes-6417'

fixes #6417
This commit is contained in:
Marius Hein 2015-01-28 17:10:52 +01:00
commit c382e0d205
18 changed files with 39 additions and 23 deletions

View File

@ -38,15 +38,17 @@ class LessCompiler
/** /**
* Create a new instance * Create a new instance
*
* @param string $basePath Provide web base path optional
*/ */
public function __construct() public function __construct($basePath = null)
{ {
require_once 'lessphp/lessc.inc.php'; require_once 'lessphp/lessc.inc.php';
$this->lessc = new lessc(); $this->lessc = new lessc();
$this->lessc->setVariables( $this->lessc->setVariables(
array( array(
'baseurl' => '\'' . Zend_Controller_Front::getInstance()->getBaseUrl(). '\'' 'baseurl' => '\'' . $basePath. '\''
) )
); );
} }

View File

@ -11,7 +11,7 @@ use Icinga\Web\LessCompiler;
class StyleSheet class StyleSheet
{ {
protected static $lessFiles = array( protected static $lessFiles = array(
'../application/fonts/fontello-ifont/css/ifont-embedded.css', 'fonts/fontello-ifont/css/ifont-embedded.less',
'css/vendor/tipsy.css', 'css/vendor/tipsy.css',
'css/icinga/defaults.less', 'css/icinga/defaults.less',
'css/icinga/layout-colors.less', 'css/icinga/layout-colors.less',
@ -96,7 +96,8 @@ class StyleSheet
$cache->send($cacheFile); $cache->send($cacheFile);
return; return;
} }
$less = new LessCompiler();
$less = new LessCompiler(dirname($_SERVER['PHP_SELF']));
foreach ($lessFiles as $file) { foreach ($lessFiles as $file) {
$less->addFile($file); $less->addFile($file);
} }

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: 'ifont'; font-family: 'ifont';
src: url('../font/ifont.eot?75097146'); src: url('@{baseurl}/fonts/fontello-ifont/font/ifont.eot?75097146');
src: url('../font/ifont.eot?75097146#iefix') format('embedded-opentype'), src: url('@{baseurl}/fonts/fontello-ifont/font/ifont.eot?75097146#iefix') format('embedded-opentype'),
url('../font/ifont.svg?75097146#ifont') format('svg'); url('@{baseurl}/fonts/fontello-ifont/ifont.svg?75097146#ifont') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,6 @@
# fontello-ifont has been moved
The font directory has been moved to the public structure because of Internet Explorer version 8 compatibility. The
common way for browsers is to include the binary embeded font type in the javascript. IE8 falls back and include one of
the provided font sources. Therefore it is important to have the font files available public and exported by the
HTTP server.

View File

@ -130,23 +130,26 @@
} }
setTimeout(function () { setTimeout(function () {
if (! $li.is('li:hover')) { try {
return; if (!$li.is('li:hover')) {
} return;
if ($li.hasClass('active')) { }
return; if ($li.hasClass('active')) {
} return;
}
} catch(e) { /* Bypass because if IE8 */ }
$li.siblings().each(function () { $li.siblings().each(function () {
var $sibling = $(this); var $sibling = $(this);
if ($sibling.is('li:hover')) { try {
return; if ($sibling.is('li:hover')) {
} return;
}
} catch(e) { /* Bypass because if IE8 */ };
if ($sibling.hasClass('hover')) { if ($sibling.hasClass('hover')) {
$sibling.removeClass('hover'); $sibling.removeClass('hover');
} }
}); });
self.hoverElement($li); self.hoverElement($li);
}, delay); }, delay);
}; };
@ -161,9 +164,11 @@
} }
setTimeout(function () { setTimeout(function () {
if ($li.is('li:hover') || $sidebar.is('sidebar:hover') ) { try {
return; if ($li.is('li:hover') || $sidebar.is('sidebar:hover')) {
} return;
}
} catch(e) { /* Bypass because if IE8 */ };
$li.removeClass('hover'); $li.removeClass('hover');
$('#layout').removeClass('hoveredmenu'); $('#layout').removeClass('hoveredmenu');
}, 500); }, 500);
@ -183,9 +188,11 @@
self = event.data.self; self = event.data.self;
setTimeout(function () { setTimeout(function () {
// TODO: make this behave well together with keyboard navigation // TODO: make this behave well together with keyboard navigation
if (! $li.is('li:hover') /*&& ! $li.find('a:focus')*/) { try {
$li.removeClass('hover'); if (!$li.is('li:hover') /*&& ! $li.find('a:focus')*/) {
} $li.removeClass('hover');
}
} catch(e) { /* Bypass because if IE8 */ }
}, 300); }, 300);
}; };
Icinga.Behaviors.Navigation = Navigation; Icinga.Behaviors.Navigation = Navigation;