Skip to content

Commit

Permalink
va al slide correspondiente al filtrar (cierra: #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvm committed May 8, 2015
1 parent bd9d529 commit e40cb2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script src="data/simulations.js"></script>

<script id="tmpl-category" type="x-tmpl-mustache">
<section data-content="category" id="section-{{key}}">
<section data-content="category">
<section data-background="#dddddd">
<h2>{{ name }}</h2>
<p>{{ cant }} simulaciones disponibles.</p>
Expand Down
12 changes: 5 additions & 7 deletions src/js/simulaciones.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ var scr_path = "file:///usr/share/huayra-simulaciones-interactivas/data/screensh
var java_jar = "java -jar ";

function load_simus(content){
for(obj in categories){
console.log(obj);
content.html('');

categories[obj]['simus'] = categories[obj]['simus'].map(function(k){ s = simulations[k]; s.name = k; return s; });
for(obj in categories){
categories[obj]['simus'] = categories[obj]['simus'].map(function(k){ if( typeof(k) == "string" ) {s = simulations[k]; s.name = k; return s;} });
categories[obj]['scr_path'] = scr_path;
categories[obj]['cant'] = categories[obj]['simus'].length;
categories[obj]['key'] = obj;


content.append(
Mustache.render($('#tmpl-category').html(), categories[obj])
);
Expand Down Expand Up @@ -50,11 +47,12 @@ function filter_sim(input){
var s_res = JSON.search(simulations,
"//*//*[contains(title, '_STR_')]//file".replace('_STR_',
input.val()));
//categories["filtrar"]['simus'] = s_res.map(function(s){ return s.replace('_es.jar', ''); });
categories.filtrar.simus = s_res.map(function(s){ return s.replace('_es.jar', ''); });
load_simus($('#content'));
setTimeout(function(){ Reveal.slide(7); },1000);
}


$(document).ready(function(){
load_simus($('#content'));

Expand Down

0 comments on commit e40cb2e

Please sign in to comment.