Commit 139dd891 authored by Aaron Harder's avatar Aaron Harder

Edit page child counter display: improve accuracy of counting logic

parent 74839fcf
......@@ -68,8 +68,12 @@ module.exports=function($, window, page, editDialog){
$el.html(`<a href="${page.blProxyPrefix}${slingPath}" target="_blank">${oldHtml}</a>`);
});
$(".collapsible-header").hover(function(){
$(".collapsible-header, .edit-button").hover(function(){
var $header=$(this);
if($header.data("target")){ // oops, acutally an edit button, not a header.
$header = $header.closest(".item-buttons").siblings(".collapsible-header");
}
var childCount = $header.data("childCount");
var off=$header.offset();
......@@ -89,7 +93,11 @@ module.exports=function($, window, page, editDialog){
if(off){$count.css("top", `${off.top}px`)};
}, function(){
$(this).find(".child-count").css("display", "none");
var $header=$(this)
if($header.data("target")){ // oops, acutally an edit button, not a header.
$header = $header.closest(".item-buttons").siblings(".collapsible-header");
}
$header.find(".child-count").css("display", "none");
})
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment