Changeset - 6f1e25144958
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 6 years ago 2020-06-18 16:08:36
mads@kiilerich.com
Grafted from: ceec08af8706
diff: fix "Show inline comments"

jQuery has weak "friendly" semantics for data attributes and do for example
interpret the data attribute name 'id_for' as 'idFor'. We could thus not
retrieve it as 'id_for'.

Instead, avoid the special semantics of '_' by just naming the data attribute
'for'.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -70,7 +70,7 @@
 
                </div>
 
                <div class="pull-right">
 
                    ${_('Show inline comments')}
 
                    ${h.checkbox('checkbox-show-inline-' + id_fid, checked="checked",class_="show-inline-comments",**{'data-id_for':id_fid})}
 
                    ${h.checkbox('checkbox-show-inline-' + id_fid, checked="checked",class_="show-inline-comments",**{'data-for':id_fid})}
 
                </div>
 
        </div>
 
        <div class="no-padding panel-body" data-f_path="${cs_filename}">
 
@@ -137,7 +137,7 @@ $(document).ready(function(){
 
        if(target == null){
 
            target = this;
 
        }
 
        var boxid = $(target).data('id_for');
 
        var boxid = $(target).data('for');
 
        if(target.checked){
 
            $('#{0} .inline-comments'.format(boxid)).show();
 
        }else{
0 comments (0 inline, 0 general)