Skip to content

Commit

Permalink
test: prevent cached stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspark committed Dec 7, 2013
1 parent 216c4ab commit 34f008a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tests/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Bootswatch: Components</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css" media="screen" id="stylesheet">
<link rel="stylesheet" href="../amelia/bootstrap.css" media="screen" id="stylesheet">
<link rel="stylesheet" href="../assets/css/bootswatch.min.css">
<style>

Expand Down Expand Up @@ -87,8 +87,8 @@
<div class="container">

<div class="page-header">
<h1 id="theme">Bootstrap</h1>
<p id="description" class="lead">The original</p>
<h1 id="theme">Amelia</h1>
<p id="description" class="lead">Sweet and cheery</p>
</div>


Expand Down Expand Up @@ -2745,11 +2745,16 @@ <h1 id="popovers">Popovers</h1>
$('body').append(menuHTML);

$('#menu').change(function(){
var theme = $('#menu :selected');
$('#theme').text(theme.text());
$('#description').text(theme.data('description'));
theme = '../' + theme.text().toLowerCase() + '/bootstrap.min.css';
$('#stylesheet').attr('href', theme);
var $theme = $('#menu :selected'),
theme = $theme.text(),
description = $theme.data('description'),
date = new Date(),
time = date.getTime()
url = '../' + theme.toLowerCase() + '/bootstrap.css?' + time;

$('#theme').text(theme);
$('#description').text(description);
$('#stylesheet').attr('href', url);
});
}, "json");

Expand Down

0 comments on commit 34f008a

Please sign in to comment.