shared conten divt: move js out from templates into theme.js

This commit is contained in:
rabuzarus 2016-05-18 14:59:35 +02:00
parent 0cafad6d2b
commit edb243e698
3 changed files with 16 additions and 27 deletions

View file

@ -68,6 +68,22 @@ $(document).ready(function(){
if( $("#jot-popup").is(":hidden")) $("#topbar-second > .container > #navbar-button #jotOpen").hide();
}
// move shared content in it's own DIV (so we can style it better)
$('.wall-item-body .shared_content').each(function() {
// create a DIV after ".shared_content" where we will putt in the shared_header
// and the "shared_content"
$(this).after('<div class="shared-content-wrapper content-card"></div>');
// get the shared_header
var sheader = $(this).prev();
// get the shared-content-wrapper which we have created above
var swrapper = $(this).next();
// move the "shared_header into the new shared_content DIV
$(swrapper).append(sheader);
// move the "shared_content" into the new DIV
$(swrapper).append(this);
});
// show bulk deletion button at network page if checkbox is checked
$('input.item-select').change(function(){
var checked = false;

View file

@ -226,16 +226,3 @@
</div><!--./media>-->
</div><!-- ./panel-body -->
</div><!--./panel-->
<script>
// Note this is the same script like in wall_thread.tpl
$(document).ready(function() {
// put shared content in an own wrapper div
$('#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content').after('<div class="shared-content-wrapper content-card"></div>');
$("#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_header, #wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content").appendTo("#wall-item-content-{{$item.id}} .shared-content-wrapper");
// put shared content in an own wrapper (with showmore addon)
$('#wall-item-content-{{$item.id}} .showmore-content > .shared_content').parent().after('<div class="shared-content-wrapper content-card"></div>');
$("#wall-item-content-{{$item.id}} .showmore-teaser > .shared_header, #wall-item-content-{{$item.id}} .showmore-content > .shared_header").parent().appendTo("#wall-item-content-{{$item.id}} .shared-content-wrapper");
});
</script>

View file

@ -402,17 +402,3 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.thread_level==2 && $top_child_nr==$top_child_total}}
</div><!--./comment-container-->
{{/if}}
<script>
// Note: this is the same script like in search_item.tpl
$(document).ready(function() {
// put shared content in an own wrapper div
$('#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content').after('<div class="shared-content-wrapper content-card"></div>');
$("#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_header, #wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content").appendTo("#wall-item-content-{{$item.id}} .shared-content-wrapper");
// put shared content in an own wrapper (with showmore addon)
$('#wall-item-content-{{$item.id}} .showmore-content > .shared_content').parent().after('<div class="shared-content-wrapper content-card"></div>');
$("#wall-item-content-{{$item.id}} .showmore-teaser > .shared_header, #wall-item-content-{{$item.id}} .showmore-content > .shared_header").parent().appendTo("#wall-item-content-{{$item.id}} .shared-content-wrapper");
});
</script>