mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-13 21:21:17 +00:00
Move expand/collapse in separate function
This commit is contained in:
parent
09d8641b1d
commit
7c91a7e3ff
|
@ -123,6 +123,27 @@ function write_commit(commit)
|
|||
var html_builder_worker = 0;
|
||||
var html_builder_tick = 0;
|
||||
|
||||
function expand_collapse()
|
||||
{
|
||||
var expander = $(this);
|
||||
|
||||
// If expanded, will be true
|
||||
var toExpand = expander.text() == "+";
|
||||
|
||||
if (toExpand)
|
||||
{
|
||||
// next step to close it
|
||||
expander.text("-");
|
||||
}
|
||||
else
|
||||
{
|
||||
// next step is to open it
|
||||
expander.text("+");
|
||||
}
|
||||
|
||||
expander.closest('tbody').toggleClass("collapsed");
|
||||
}
|
||||
|
||||
function update_diff(id, lsettings)
|
||||
{
|
||||
if (html_builder_worker)
|
||||
|
@ -192,26 +213,7 @@ function update_diff(id, lsettings)
|
|||
|
||||
content.html(event.data.diff_html);
|
||||
|
||||
$(".expander").click(function()
|
||||
{
|
||||
var expander = $(this);
|
||||
|
||||
// If expanded, will be true
|
||||
var toExpand = expander.text() == "+";
|
||||
|
||||
if (toExpand)
|
||||
{
|
||||
// next step to close it
|
||||
expander.text("-");
|
||||
}
|
||||
else
|
||||
{
|
||||
// next step is to open it
|
||||
expander.text("+");
|
||||
}
|
||||
|
||||
expander.closest('tbody').toggleClass("collapsed");
|
||||
});
|
||||
$(".expander").click(expand_collapse);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue