-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.php
35 lines (34 loc) · 1.05 KB
/
template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* Implements theme_preprocess_page(&$variables);
*/
function fjernvarme_preprocess_html(&$variables) {
drupal_add_css(drupal_get_path('theme', 'precision') .'/css/grid.css');
drupal_add_js('
function hasBorderRadius() {
var d = document.createElement("div").style;
if (typeof d.borderRadius !== "undefined") return true;
if (typeof d.WebkitBorderRadius !== "undefined") return true;
if (typeof d.MozBorderRadius !== "undefined") return true;
return false;
};
(function ($) {
$(document).ready(function() {
if (hasBorderRadius()) { // 1
$(".img-rounded-corners img").each(function() { // 2
$(this).wrap(\'<div class="img-rounded-corners" />\'); // 3
var imgSrc = $(this).attr("src"); // 4
var imgHeight = $(this).height(); // 4
var imgWidth = $(this).width(); // 4
$(this).parent()
.css("background-image", "url(" + imgSrc + ")")
.css("background-repeat","no-repeat")
.css("height", imgHeight + "px")
.css("width", imgWidth + "px"); // 5
$(this).remove(); // 6
});
}
});
})(jQuery);
', 'inline');
}