# HG changeset patch # User cavaliet # Date 1395240934 -3600 # Node ID 68746521df51f1eef1336db8350a15ff63444a83 # Parent 3fdccf07adaf3bd076255f51cdd7d1d5b1db4e8b chapters : remove tag by click diff -r 3fdccf07adaf -r 68746521df51 src/spel/static/spel/js/spectacle.js --- a/src/spel/static/spel/js/spectacle.js Wed Mar 19 14:58:31 2014 +0100 +++ b/src/spel/static/spel/js/spectacle.js Wed Mar 19 15:55:34 2014 +0100 @@ -141,6 +141,28 @@ }); }); + + + // click-to-remove-tag management for chapter + $(".chapter-results").on("click", ".chapter-tag-list .glyphicon-remove", function(){ + console.log(this, $(this).parent().text().trim()); + if($(this).parent().hasClass("type")){ + $("#mulsel1").multiselect('deselect', $(this).parent().text().trim()); + } + else if($(this).parent().hasClass("modscen")){ + $("#mulsel2").multiselect('deselect', "modalites_sceniques: " + $(this).parent().text().trim()); + } + else if($(this).parent().hasClass("perso")){ + $("#mulsel3").multiselect('deselect', "personnages: " + $(this).parent().text().trim()); + } + $("#btn-filter-chapters").click(); + // manage when nothing is selected + if($(".chapter-tag-list").children().length==0){ + $(".chapter-results").html(''); + } + }); + + // table sorter config $.extend($.tablesorter.themes.bootstrap, { // these classes are added to the table. To see other table classes available, // look here: http://twitter.github.com/bootstrap/base-css.html#tables @@ -243,7 +265,7 @@ $(".nb-annotations-found").html($('.annotation-results > div:visible').length); }); - // click-to-remove-tag management + // click-to-remove-tag management for annotations $(".annotation-results").on("click", ".annot-tag-list .glyphicon-remove", function(){ console.log(this, $(this).parent().text().trim()); if($(this).parent().children().first().hasClass("glyphicon-search")){ diff -r 3fdccf07adaf -r 68746521df51 src/spel/templates/partial/spel_chapters.html --- a/src/spel/templates/partial/spel_chapters.html Wed Mar 19 14:58:31 2014 +0100 +++ b/src/spel/templates/partial/spel_chapters.html Wed Mar 19 15:55:34 2014 +0100 @@ -1,6 +1,11 @@ {% load static %} {% load front_tags %} {% load spel_tags %} +
{{ segments|length }} segment(s) trouvé(s)