Skip to content

Commit

Permalink
Minor simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Mar 16, 2024
1 parent bd23241 commit 32e10b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions itables/javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import uuid
import warnings
from base64 import b64encode
from copy import deepcopy
from pathlib import Path

import numpy as np
Expand Down Expand Up @@ -475,7 +474,7 @@ def set_default_options(kwargs, use_to_html):
and not option.startswith("__")
and option not in {"dt_bundle", "find_package_file", "UNPKG_DT_BUNDLE_URL"}
):
kwargs[option] = deepcopy(getattr(opt, option))
kwargs[option] = getattr(opt, option)

for name, value in kwargs.items():
if value is None:
Expand Down Expand Up @@ -598,7 +597,11 @@ def html_table_from_template(
connected_import = (
"import {DataTable, jQuery as $} from '" + UNPKG_DT_BUNDLE_URL + "';"
)
local_import = "const { DataTable, jQuery: $ } = await import(window._datatables_src_for_itables);"
local_import = (
"const { DataTable, jQuery: $ } = await import(window."
+ DATATABLES_SRC_FOR_ITABLES
+ ");"
)
output = replace_value(output, connected_import, local_import)

output = replace_value(
Expand All @@ -607,10 +610,6 @@ def html_table_from_template(
html_table,
)
output = replace_value(output, "#table_id", "#{}".format(table_id))
if not connected:
output = replace_value(
output, "_datatables_src_for_itables", DATATABLES_SRC_FOR_ITABLES
)

if column_filters:
# If the below was false, we would need to concatenate the JS code
Expand Down
2 changes: 1 addition & 1 deletion itables/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""ITables' version number"""

__version__ = "2.0.0rc5"
__version__ = "2.0.0rc6"

0 comments on commit 32e10b1

Please sign in to comment.