Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotttf committed Feb 22, 2012
1 parent fc46cb9 commit f32dad6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,15 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer
),
'inline' => array(),
);
// We never cache authenticated user pages, so if they are logged in we
// allow setting of the has_js cookie so batch API functions use the JS
// version.
// user_is_anonymous() is not used here because it is unavailable during
// installation.
// @see user_is_anonymous()
if (!empty($GLOBALS['user']->uid) || isset($GLOBALS['menu_admin'])) {
$javascript['footer']['inline'][] = array('code' => "document.cookie = 'has_js=1; path=/';", 'defer' => TRUE);
}
}

if (isset($scope) && !isset($javascript[$scope])) {
Expand Down

0 comments on commit f32dad6

Please sign in to comment.