Restore out of band data saved to cache. Copied from Panels.
function restore_headers() {
if (!empty($this->storage['head'])) {
drupal_add_html_head($this->storage['head']);
}
if (!empty($this->storage['css'])) {
foreach ($this->storage['css'] as $args) {
$this->view->element['#attached']['css'][] = $args;
}
}
if (!empty($this->storage['js'])) {
foreach ($this->storage['js'] as $key => $args) {
if ($key !== 'settings') {
$this->view->element['#attached']['js'][] = $args;
}
else {
foreach ($args as $setting) {
$this->view->element['#attached']['js']['setting'][] = $setting;
}
}
}
}
}