Skip to content

Commit

Permalink
ref: SymfonyCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Jan 14, 2024
1 parent 232ebd6 commit 8091df3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions EMS/admin-ui-bundle/assets/js/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import NestedSortable from './plugins/nestedSortable'
import ObjectPicker from './plugins/objectPicker'
import Select from './plugins/select'
import SortableList from './plugins/sortableList'
import SymfonyCollection from './plugins/symfonyCollection'
import Tooltip from './plugins/tooltip'
import WYSIWYG from './plugins/wysiwyg'

Expand All @@ -30,6 +31,7 @@ class Core {
new ObjectPicker(),
new Select(),
new SortableList(),
new SymfonyCollection(),
new Tooltip(),
new WYSIWYG()
]
Expand Down
17 changes: 17 additions & 0 deletions EMS/admin-ui-bundle/assets/js/core/plugins/symfonyCollection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import $ from 'jquery'
import a2lixLib from '@a2lix/symfony-collection/dist/a2lix_sf_collection.min'

export default class SymfonyCollection {
load (target) {
$(target).find('.a2lix_lib_sf_collection').each(function () {
a2lixLib.sfCollection.init({
collectionsSelector: '#' + $(this).attr('id'),
manageRemoveEntry: true,
lang: {
add: $(this).data('lang-add'),
remove: $(this).data('lang-remove')
}
})
})
}
}

0 comments on commit 8091df3

Please sign in to comment.