Changeset - dd8459607c07
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2015-04-28 16:55:05
madski@unity3d.com
permissions: small template/javascript refactorings
1 file changed with 6 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/base/perms_summary.html
Show inline comments
 
@@ -99,34 +99,31 @@
 
    $(document).ready(function(){
 
        var show_empty = function(section){
 
            var visible = $('.section_{0} tr.perm_row:visible'.format(section)).length;
 
            console.log(visible)
 
            console.log($('.section_{0} tr.perm_row:visible'.format(section)))
 
            if(visible == 0){
 
                $('#empty_{0}'.format(section)).show();
 
            }
 
            else{
 
                $('#empty_{0}'.format(section)).hide();
 
            }
 
        }
 
        $('.perm_filter').on('change', function(e){
 
            var self = this;
 
            var section = $(this).attr('section');
 
        var update_show = function($checkbox){
 
            var section = $checkbox.attr('section');
 

	
 
            var opts = {}
 
            var elems = $('.filter_' + section).each(function(el){
 
                var perm_type = $(this).attr('perm_type');
 
                var checked = this.checked;
 
                opts[perm_type] = checked;
 
                var perm_type = $checkbox.attr('perm_type');
 
                var checked = $checkbox.checked;
 
                if(checked){
 
                    $('.'+section+'_'+perm_type).show();
 
                }
 
                else{
 
                    $('.'+section+'_'+perm_type).hide();
 
                }
 
            });
 
            show_empty(section);
 
        })
 

	
 
        }
 
        $('.perm_filter').on('change', function(){update_show($(this));});
 
    })
 
</script>
 
</%def>
0 comments (0 inline, 0 general)