Add support for server-side triggered CSS reload
This commit is contained in:
parent
87f90b6bdd
commit
eeaec20873
|
@ -68,6 +68,8 @@ class ActionController extends Zend_Controller_Action
|
|||
|
||||
private $noXhrBody = false;
|
||||
|
||||
private $reloadCss = false;
|
||||
|
||||
private $windowId;
|
||||
|
||||
// TODO: This would look better if we had a ModuleActionController
|
||||
|
@ -149,6 +151,11 @@ class ActionController extends Zend_Controller_Action
|
|||
return $this->windowId;
|
||||
}
|
||||
|
||||
protected function reloadCss()
|
||||
{
|
||||
$this->reloadCss = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a window-aware session by using the given prefix
|
||||
*
|
||||
|
@ -370,6 +377,10 @@ class ActionController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
if ($isXhr && ($this->reloadCss || $this->getParam('_reload') === 'css')) {
|
||||
header('X-Icinga-CssReload: now');
|
||||
}
|
||||
|
||||
if ($isXhr && $this->noXhrBody) {
|
||||
header('X-Icinga-Container: ignore');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue