Skip to content

Commit

Permalink
Merge pull request #42 from Mygod/datatable-autosize
Browse files Browse the repository at this point in the history
Auto size datatables
  • Loading branch information
versx authored Aug 17, 2020
2 parents b32ff2a + 49a4fb9 commit 691e5b8
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/views/index-js.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5146,7 +5146,6 @@ function convertAreaToSqkm(value) {
// MARK: - Init Filter

function loadPokemonFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-pokemon').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5192,7 +5191,7 @@ function loadPokemonFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5252,7 +5251,6 @@ function loadPokemonFilter () {
}

function loadQuestFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-quest').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5292,7 +5290,7 @@ function loadQuestFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5350,7 +5348,6 @@ function loadQuestFilter () {
}

function loadRaidFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-raid').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5390,7 +5387,7 @@ function loadRaidFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5448,7 +5445,6 @@ function loadRaidFilter () {
}

function loadGymFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-gym').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5488,7 +5484,7 @@ function loadGymFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5546,7 +5542,6 @@ function loadGymFilter () {
}

function loadPokestopFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-pokestop').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5586,7 +5581,7 @@ function loadPokestopFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5644,7 +5639,6 @@ function loadPokestopFilter () {
}

function loadInvasionFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-invasion').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5684,7 +5678,7 @@ function loadInvasionFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5742,7 +5736,6 @@ function loadInvasionFilter () {
}

function loadSpawnpointFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-spawnpoint').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5782,7 +5775,7 @@ function loadSpawnpointFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5840,7 +5833,6 @@ function loadSpawnpointFilter () {
}

function loadNestFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-nest').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5880,7 +5872,7 @@ function loadNestFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -5938,7 +5930,6 @@ function loadNestFilter () {
}

function loadWeatherFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-weather').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -5977,7 +5968,7 @@ function loadWeatherFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down Expand Up @@ -6035,7 +6026,6 @@ function loadWeatherFilter () {
}

function loadDeviceFilter () {
const scrollHeight = $(document).height() * 0.5;
const table = $('#table-filter-device').DataTable({
language: {
search: i18n('filter_table_search'),
Expand Down Expand Up @@ -6075,7 +6065,7 @@ function loadDeviceFilter () {
targets: 2
}],
deferRender: true,
scrollY: scrollHeight,
scrollY: '50vh',
scrollCollapse: false,
scroller: true,
lengthChange: false,
Expand Down

0 comments on commit 691e5b8

Please sign in to comment.