Skip to content

Commit

Permalink
fix(Rozier): Call off() on undefined element
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Sep 18, 2023
1 parent 9a170d5 commit dd4324d
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 16 deletions.
18 changes: 12 additions & 6 deletions lib/Rozier/src/Resources/app/Rozier.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,22 @@ export default class Rozier {
bindMainTrees() {
// TREES
let $nodeTree = $('.nodetree-widget .root-tree')
$nodeTree.off('change.uk.nestable')
$nodeTree.on('change.uk.nestable', this.onNestableNodeTreeChange)
if ($nodeTree.length) {
$nodeTree.off('change.uk.nestable')
$nodeTree.on('change.uk.nestable', this.onNestableNodeTreeChange)
}

let $tagTree = $('.tagtree-widget .root-tree')
$tagTree.off('change.uk.nestable')
$tagTree.on('change.uk.nestable', this.onNestableTagTreeChange)
if ($tagTree.length) {
$tagTree.off('change.uk.nestable')
$tagTree.on('change.uk.nestable', this.onNestableTagTreeChange)
}

let $folderTree = $('.foldertree-widget .root-tree')
$folderTree.off('change.uk.nestable')
$folderTree.on('change.uk.nestable', this.onNestableFolderTreeChange)
if ($folderTree.length) {
$folderTree.off('change.uk.nestable')
$folderTree.on('change.uk.nestable', this.onNestableFolderTreeChange)
}

// Tree element name
this.$mainTreeElementName = this.$mainTrees.find('.tree-element-name')
Expand Down
4 changes: 3 additions & 1 deletion lib/Rozier/src/Resources/app/components/tabs/MainTreeTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export default class MainTreeTabs {
}

unbind() {
this.tabsMenu.off('change.uk.tab', this.onTabChange)
if (this.tabsMenu) {
this.tabsMenu.off('change.uk.tab', this.onTabChange)
}
}

onTabChange(event, activeItem, previousItem) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<link href="{{ asset('css/vendor.00b2be12b114cc414b2c.css', 'Rozier') }}" rel="stylesheet">

<link href="{{ asset('css/app.44c39cecf098349e8d63.css', 'Rozier') }}" rel="stylesheet">
<link href="{{ asset('css/app.0233cdc4d2bebcd7bc96.css', 'Rozier') }}" rel="stylesheet">



Expand Down
4 changes: 2 additions & 2 deletions lib/Rozier/src/Resources/views/partials/js-inject.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<script src="{{ asset('js/vendor.118e12fff2243a310d56.js', 'Rozier') }}" defer type="text/javascript"></script>
<script src="{{ asset('js/vendor.9a0ad0e6c30086c8785f.js', 'Rozier') }}" defer type="text/javascript"></script>

<script src="{{ asset('js/app.118e12fff2243a310d56.js', 'Rozier') }}" defer type="text/javascript"></script>
<script src="{{ asset('js/app.9a0ad0e6c30086c8785f.js', 'Rozier') }}" defer type="text/javascript"></script>

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

<script src="{{ asset('js/simple.118e12fff2243a310d56.js', 'Rozier') }}" defer type="text/javascript"></script>
<script src="{{ asset('js/simple.9a0ad0e6c30086c8785f.js', 'Rozier') }}" defer type="text/javascript"></script>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/Rozier/src/static/css/app.0233cdc4d2bebcd7bc96.css.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/Rozier/src/static/css/app.44c39cecf098349e8d63.css.map

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit dd4324d

Please sign in to comment.