diff options
author | Juho Jaakkola <juho.jaakkola@mediamaisteri.com> | 2013-10-31 04:58:39 -0700 |
---|---|---|
committer | Juho Jaakkola <juho.jaakkola@mediamaisteri.com> | 2013-10-31 04:58:39 -0700 |
commit | 267ab289f7209118885438d022ada99ea2079c38 (patch) | |
tree | e9160c98aad5699f086b4bcb2a071be18e227425 /engine/classes | |
parent | cf15fc159f53aee4f05ab937fd458d33433ace18 (diff) | |
parent | 577201be6cff3dbe2a0ee6e35c9ab33a74a55f77 (diff) | |
download | elgg-267ab289f7209118885438d022ada99ea2079c38.tar.gz elgg-267ab289f7209118885438d022ada99ea2079c38.tar.bz2 |
Merge pull request #6171 from jdalsem/widget-reorder-issue
fixed issue when reordering plugins to second last position of other column that has more than 2 widgets
Diffstat (limited to 'engine/classes')
-rw-r--r-- | engine/classes/ElggWidget.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php index c123e5032..66191bf47 100644 --- a/engine/classes/ElggWidget.php +++ b/engine/classes/ElggWidget.php @@ -146,10 +146,15 @@ class ElggWidget extends ElggObject { } } + $bottom_rank = count($widgets); + if ($column == $this->column) { + $bottom_rank--; + } + if ($rank == 0) { // top of the column $this->order = reset($widgets)->order - 10; - } elseif ($rank == (count($widgets) - 1)) { + } elseif ($rank == $bottom_rank) { // bottom of the column of active widgets $this->order = end($widgets)->order + 10; } else { |