mirror of
https://github.com/friendica/friendica
synced 2025-04-24 05:10:11 +00:00
Add menu entry to directly collapse posts
This commit is contained in:
parent
28185c12fc
commit
1744f6b2c3
7 changed files with 182 additions and 110 deletions
|
@ -206,6 +206,10 @@ function confirmIgnore() {
|
|||
return confirm(aStr.ignoreAuthor);
|
||||
}
|
||||
|
||||
function confirmCollapse() {
|
||||
return confirm(aStr.collapseAuthor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide and removes an item element from the DOM after the deletion url is
|
||||
* successful, restore it else.
|
||||
|
@ -292,4 +296,33 @@ function ignoreAuthor(url, elementId) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapse author posts
|
||||
*
|
||||
* @param {string} url The item collapse URL
|
||||
* @param {string} elementId The DOM id of the item element
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function collapseAuthor(url, elementId) {
|
||||
if (confirmCollapse()) {
|
||||
$("body").css("cursor", "wait");
|
||||
|
||||
var $el = $(document.getElementById(elementId));
|
||||
|
||||
$el.fadeTo("fast", 0.33, function () {
|
||||
$.get(url)
|
||||
.then(function () {
|
||||
//$el.remove();
|
||||
})
|
||||
.fail(function () {
|
||||
// @todo Show related error message
|
||||
$el.show();
|
||||
})
|
||||
.always(function () {
|
||||
$("body").css("cursor", "auto");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
// @license-end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue