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