Merge branch 'master' of mjesec.ffzg.hr:/git/MojoFacets
[MojoFacets.git] / templates / all_checkboxes.html.ep
index 3e5a6f9..4fcbeff 100644 (file)
@@ -3,9 +3,8 @@
 <a id="toggle" href="#">toggle</a>
 <a id="none" href="#">none</a>
 
-<label for=filter_regex>regex:
-<input type=text name=filter_regex>
-<span class=hint>tab or click outside to apply</span>
+<label for=filter_regex>
+<input  type=text name=filter_regex title="enter regex to filter values" placeholder="regex">
 <a id="included" href="#" style="display:none">included</a>
 <a id="excluded" href="#" style="display:none">excluded</a>
 </label>
@@ -71,12 +70,16 @@ $('a#excluded').click( function(){
 // regex for column names
 
 var apply_regex = function(e) {
-       console.debug( this, e );
-       var r = new RegExp( this.value ,'i');
+       var user_regex = this.value;
+       console.debug( this, e, user_regex );
+
+       if ( user_regex == '' ) return false;
+
+       var r = new RegExp( user_regex,'i');
        var included = 0;
        var excluded = 0;
     $("input[type='checkbox']:not([disabled='disabled'])").each( function(i,element){
-               if ( r.test( this.value ) ) {
+               if ( r.test( v ) ) {
                        $(this).parent().removeClass('excluded').addClass('included');
                        included++;
                } else {