mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-07-31 10:30:15 +02:00
Improves display of 'empty' string for empty folders.
This commit is contained in:
@@ -18,7 +18,7 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c
|
|||||||
'</a>' +
|
'</a>' +
|
||||||
'</li>',
|
'</li>',
|
||||||
hintTemplate = '<span class="hint"></span>',
|
hintTemplate = '<span class="hint"></span>',
|
||||||
listTemplate = '<ul class="clearfix">' +
|
listTemplate = '<ul>' +
|
||||||
'<li class="header">' +
|
'<li class="header">' +
|
||||||
'<a class="icon"></a>' +
|
'<a class="icon"></a>' +
|
||||||
'<a class="label" href="#"><span class="l10n-name"></span></a>' +
|
'<a class="label" href="#"><span class="l10n-name"></span></a>' +
|
||||||
@@ -100,7 +100,8 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c
|
|||||||
init = function (entry) {
|
init = function (entry) {
|
||||||
|
|
||||||
var $extended = $('#extended'),
|
var $extended = $('#extended'),
|
||||||
$ul = $(listTemplate);
|
$ul = $(listTemplate),
|
||||||
|
$emtpy = $(emptyTemplate);
|
||||||
|
|
||||||
if (entry.parent) {
|
if (entry.parent) {
|
||||||
$ul.append(update(entry.parent));
|
$ul.append(update(entry.parent));
|
||||||
@@ -117,9 +118,10 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c
|
|||||||
});
|
});
|
||||||
|
|
||||||
$extended.append($ul);
|
$extended.append($ul);
|
||||||
|
$extended.append($emtpy);
|
||||||
|
|
||||||
if (entry.isEmpty()) {
|
if (!entry.isEmpty()) {
|
||||||
$extended.append($(emptyTemplate));
|
$emtpy.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$extended
|
$extended
|
||||||
@@ -136,14 +138,21 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c
|
|||||||
event.sub('entry.created', function (entry) {
|
event.sub('entry.created', function (entry) {
|
||||||
|
|
||||||
if (entry.isInCurrentFolder() && !entry.$extended) {
|
if (entry.isInCurrentFolder() && !entry.$extended) {
|
||||||
$ul.append(update(entry, true));
|
update(entry, true).hide().appendTo($ul).slideDown(400);
|
||||||
|
$emtpy.slideUp(400);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
event.sub('entry.removed', function (entry) {
|
event.sub('entry.removed', function (entry) {
|
||||||
|
|
||||||
if (entry.isInCurrentFolder() && entry.$extended) {
|
if (entry.isInCurrentFolder() && entry.$extended) {
|
||||||
entry.$extended.remove();
|
entry.$extended.slideUp(400, function () {
|
||||||
|
entry.$extended.remove();
|
||||||
|
|
||||||
|
if (entry.parent.isEmpty()) {
|
||||||
|
$emtpy.slideDown(400);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user