mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
Restored seeder and fixed scroll on firefox
This commit is contained in:
parent
c1627a1468
commit
9dfbea8bf9
@ -15,11 +15,11 @@ class DummyContentSeeder extends Seeder
|
||||
$role = \BookStack\Role::getRole('editor');
|
||||
$user->attachRole($role);
|
||||
|
||||
|
||||
factory(\BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id])
|
||||
->each(function($book) use ($user) {
|
||||
$chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id])->each(function($chapter) use ($user, $book) {
|
||||
$pages = factory(\BookStack\Page::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]);
|
||||
$chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id])
|
||||
->each(function($chapter) use ($user, $book){
|
||||
$pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]);
|
||||
$chapter->pages()->saveMany($pages);
|
||||
});
|
||||
$pages = factory(\BookStack\Page::class, 3)->make(['created_by' => $user->id, 'updated_by' => $user->id]);
|
||||
@ -32,7 +32,6 @@ class DummyContentSeeder extends Seeder
|
||||
$chapters = factory(\BookStack\Chapter::class, 50)->make(['created_by' => $user->id, 'updated_by' => $user->id]);
|
||||
$largeBook->pages()->saveMany($pages);
|
||||
$largeBook->chapters()->saveMany($chapters);
|
||||
|
||||
app(\BookStack\Services\PermissionService::class)->buildJointPermissions();
|
||||
app(\BookStack\Services\SearchService::class)->indexAllEntities();
|
||||
}
|
||||
|
@ -93,7 +93,8 @@ Controllers(ngApp, window.$events);
|
||||
*/
|
||||
window.scrollToElement = function(element) {
|
||||
if (!element) return;
|
||||
let top = element.getBoundingClientRect().top + document.body.scrollTop;
|
||||
let offset = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
||||
let top = element.getBoundingClientRect().top + offset;
|
||||
$('html, body').animate({
|
||||
scrollTop: top - 60 // Adjust to change final scroll position top margin
|
||||
}, 300);
|
||||
|
Loading…
Reference in New Issue
Block a user