Skip to content

Commit

Permalink
Add reference to patch_tabulator (#7423)
Browse files Browse the repository at this point in the history
* add reference to patch_tabulator

* Bump pre-commit

---------

Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
  • Loading branch information
hoxbro and philippjfr authored Oct 21, 2024
1 parent 0930d27 commit c6505f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
exclude: \.min\.js$
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.0
hooks:
- id: ruff
files: panel/
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
- id: oxipng
stages: [manual]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.12.0
rev: v9.13.0
hooks:
- id: eslint
args: ['-c', 'panel/.eslintrc.js', 'panel/*.ts', 'panel/models/**/*.ts', '--fix']
Expand Down
3 changes: 2 additions & 1 deletion panel/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,14 @@ def bundle_icons(verbose=False, external=True, download_list=None):
shutil.copyfile(icon, dest_dir / os.path.basename(icon))

def patch_tabulator():
# https://github.com/olifolkerd/tabulator/issues/4421
path = BUNDLE_DIR / 'datatabulator' / 'tabulator-tables@6.3.0' / 'dist' / 'js' / 'tabulator.min.js'
text = path.read_text()
# https://github.com/olifolkerd/tabulator/issues/4421
old = '"focus"!==this.options("editTriggerEvent")&&"click"!==this.options("editTriggerEvent")'
new = '"click"!==this.options("editTriggerEvent")'
assert text.count(old) == 1
text = text.replace(old, new)
# https://github.com/olifolkerd/tabulator/pull/4598
old = '(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw())'
new = '(i=!0,this.redrawing||(this.redrawing=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw(),this.redrawing=!1))'
assert text.count(old) == 1
Expand Down

0 comments on commit c6505f0

Please sign in to comment.