Skip to content

Instantly share code, notes, and snippets.

@dobesv
Created October 25, 2011 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dobesv/1311372 to your computer and use it in GitHub Desktop.
Save dobesv/1311372 to your computer and use it in GitHub Desktop.
Example of an issue in the purejs templating engine where a css class that is modified by the directives cannot be used in selector matching
<html>
<head>
<title>Test</title>
</head>
<body>
<div id='container'>
<div class='foo'>
<div class='bar'>
bla
</div>
</div>
</div>
<script type='text/javascript' src='http://beebole.com/pure/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript' src='http://beebole.com/pure/wp-includes/js/jquery/jquery.js?ver=1.4.4'></script>
<script type='text/javascript' src='http://beebole.com/pure/wp-content/themes/BeeBole-pure/libs/json2.js'></script>
<script type='text/javascript' src='http://beebole.com/pure/wp-content/themes/BeeBole-pure/libs/pure.js'></script>
<script>
console.log('Before compile ... ');
$p('#container').compile({
//'.foo@class+':'cssToAppend',
'.foo .bar':'barText'
});
console.log('Compiled first version ...');
$p('#container').compile({
'.foo@class+':'cssToAppend',
'.foo .bar':'barText'
});
console.log('Compiled second version ...');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment