Skip to content

Commit e090c6d

Browse files
committed
smoother fade-out of empty my-view sections
1 parent 9750a88 commit e090c6d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

www/scripts/sepiaFW.ui.myView.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function sepiaFW_build_ui_my_view(){
2020
}
2121

2222
function findOrCreateMyViewSection(sectionName){
23-
var sectionClass = "sepiaFW-section-" + sectionName.replace(/_/g, "-");
23+
var sectionClass = "sepiaFW-section-mv-" + sectionName.replace(/^section_/, "").replace(/_/g, "-");
2424
var $res = $('#sepiaFW-my-view').find(".sepiaFW-my-view-section." + sectionClass);
2525
if ($res.length > 0){
2626
return $res[0];
@@ -77,8 +77,12 @@ function sepiaFW_build_ui_my_view(){
7777
}
7878
//check if section is empty and handle
7979
MyView.handleEmptySection = function(sectionElement){
80-
if ($(sectionElement).children().not("p").length == 0){
81-
$(sectionElement).remove();
80+
var $sectionElement = $(sectionElement);
81+
if ($sectionElement.children().not("p").length == 0){
82+
//animated remove
83+
$sectionElement.hide(150, function(){
84+
$sectionElement.remove();
85+
});
8286
}
8387
}
8488

0 commit comments

Comments
 (0)