Skip to content

Commit

Permalink
Fixed #23: Prepend added option doesn't work with existing models
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Oct 21, 2015
1 parent 05d6f25 commit dbe6ea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ protected function getInitialSortByPosition($position)
protected function prependAdded()
{
$this->resolveConflict(1, false);

if ($this->model->isNewRecord) {
$this->setSort($this->getInitialSortByPosition(1));
}
$this->setSort($this->getInitialSortByPosition(1));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ protected function prependAdded()
$sort = $this->getSortByInterval([0, $this->getFirstSort()]);
if (!$sort) {
$this->resolveConflict(1, false);

if ($this->model->isNewRecord) {
$this->setSort($this->getInitialSortByPosition(1));
}
$this->setSort($this->getInitialSortByPosition(1));

return;
}
Expand Down

0 comments on commit dbe6ea1

Please sign in to comment.