summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-07-12 14:11:14 (GMT)
committer Alex Pott2013-07-12 15:52:32 (GMT)
commite5b197370604e193d9d7ce9bfaa493601343cd5b (patch)
tree027dc3035a1a370e2eb0bbebefa544e5ba32acca
parent2644090a6410d5cb957c0a9eb3848bb84a6047ed (diff)
Issue #2010636 by mcjim, Wim Leers, typhonius: Remove drupal_add_css() and drupal_add_js() from color.module — use #attached.
-rw-r--r--core/modules/color/color.module8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 7660d6b..cbfc67c 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -236,17 +236,17 @@ function color_scheme_form($complete_form, &$form_state, $theme) {
* - form: A render element representing the form.
*/
function template_preprocess_color_scheme_form(&$variables) {
- $form = $variables['form'];
+ $form = &$variables['form'];
$theme = $form['theme']['#value'];
$info = $form['info']['#value'];
$path = drupal_get_path('theme', $theme) . '/';
- drupal_add_css($path . $info['preview_css']);
- // @todo Transform to add library.
+ $preview_css_path = $path . $info['preview_css'];
$preview_js_path = isset($info['preview_js']) ? $path . $info['preview_js'] : drupal_get_path('module', 'color') . '/' . 'preview.js';
+ $form['scheme']['#attached']['css'][$preview_css_path] = array();
// Add the JS at a weight below color.js.
- drupal_add_js($preview_js_path, array('weight' => -1));
+ $form['scheme']['#attached']['js'][$preview_js_path] = array('weight' => -1);
// Attempt to load preview HTML if the theme provides it.
$preview_html_path = DRUPAL_ROOT . '/' . (isset($info['preview_html']) ? drupal_get_path('theme', $theme) . '/' . $info['preview_html'] : drupal_get_path('module', 'color') . '/preview.html');