function views_add_js
Same name in other branches
- 7.x-3.x views.module \views_add_js()
Include views .js files.
6 calls to views_add_js()
- template_preprocess_views_ui_edit_view in includes/
admin.inc - Preprocess the view edit page.
- template_preprocess_views_ui_list_views in includes/
admin.inc - Preprocess the list views theme
- template_preprocess_views_view in theme/
theme.inc - Preprocess the primary theme implementation for a view.
- views_exposed_form in ./
views.module - Form builder for the exposed widgets form.
- views_process_dependency in includes/
form.inc - Process callback to add dependency to form items.
File
-
./
views.module, line 790
Code
function views_add_js($file) {
// If javascript has been disabled by the user, never add js files.
if (variable_get('views_no_javascript', FALSE)) {
return;
}
static $base = TRUE;
if ($base) {
drupal_add_js(drupal_get_path('module', 'views') . "/js/base.js");
$base = FALSE;
}
drupal_add_js(drupal_get_path('module', 'views') . "/js/{$file}.js");
}