mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Can't cache javascript that is supposed to run
From the CaptureHelper docu¹ ``` WARNING: content_for is ignored in caches. So you shouldn't use it for elements that will be fragment cached. ``` ¹ https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for
This commit is contained in:
parent
072116fffe
commit
5aa85f233e
1 changed files with 17 additions and 18 deletions
|
|
@ -64,22 +64,21 @@
|
|||
= render 'social_media', contact: @conference.contact
|
||||
= render 'footer'
|
||||
|
||||
- cache [@conference.color, '#splash#inlinejs'] do
|
||||
- content_for :script_head do
|
||||
:javascript
|
||||
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
|
||||
var triangle_colors = triangle_tcs.map(function(t) {
|
||||
return t.toHexString();
|
||||
});
|
||||
$(function () {
|
||||
$(document).ready(function() {
|
||||
var triangle_width = document.body.clientWidth;
|
||||
var triangle_height = ($( "#banner" ).height() + 200 );
|
||||
var pattern = Trianglify({ width: triangle_width,
|
||||
height: triangle_height,
|
||||
cell_size: 100,
|
||||
x_colors: triangle_colors
|
||||
});
|
||||
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
|
||||
});
|
||||
- content_for :script_head do
|
||||
:javascript
|
||||
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
|
||||
var triangle_colors = triangle_tcs.map(function(t) {
|
||||
return t.toHexString();
|
||||
});
|
||||
$(function () {
|
||||
$(document).ready(function() {
|
||||
var triangle_width = document.body.clientWidth;
|
||||
var triangle_height = ($( "#banner" ).height() + 200 );
|
||||
var pattern = Trianglify({ width: triangle_width,
|
||||
height: triangle_height,
|
||||
cell_size: 100,
|
||||
x_colors: triangle_colors
|
||||
});
|
||||
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue