[facet][RangeFacet] submit facet form when the user stops sliding
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 26 May 2009 09:03:24 +0200
changeset 1933 f40ee76ecdf1
parent 1912 2b9432262240
child 1938 bf27b4190739
[facet][RangeFacet] submit facet form when the user stops sliding
web/facet.py
--- a/web/facet.py	Mon May 25 12:21:06 2009 +0200
+++ b/web/facet.py	Tue May 26 09:03:24 2009 +0200
@@ -576,11 +576,15 @@
 	min: %(minvalue)s,
 	max: %(maxvalue)s,
         values: [%(minvalue)s, %(maxvalue)s],
+        stop: function(event, ui) { // submit when the user stops sliding
+           var form = $('#%(sliderid)s').closest('form');
+           buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs')));
+        },
     	slide: function(event, ui) {
-	    $('#%(sliderid)s_inf').html(ui.values[0]);
-	    $('#%(sliderid)s_sup').html(ui.values[1]);
-	    $('input[name=%(facetid)s_inf]').val(ui.values[0]);
-	    $('input[name=%(facetid)s_sup]').val(ui.values[1]);
+            $('#%(sliderid)s_inf').html(ui.values[0]);
+            $('#%(sliderid)s_sup').html(ui.values[1]);
+            $('input[name=%(facetid)s_inf]').val(ui.values[0]);
+            $('input[name=%(facetid)s_sup]').val(ui.values[1]);
     	}
    });
 '''