Skip to content

Commit

Permalink
Replace jQuery.selector usage
Browse files Browse the repository at this point in the history
It has been removed in jQuery 3 and can easily be replaced
by template strings.
  • Loading branch information
tvdeyen committed Nov 3, 2023
1 parent 9b67916 commit 044c7fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Alchemy.ElementsWindow =
$.get @url, (data) =>
@element_area.html data
Alchemy.GUI.init(@element_area)
Alchemy.fileEditors(@element_area.find(".ingredient-editor.file, .ingredient-editor.audio, .ingredient-editor.video").selector)
Alchemy.pictureEditors(@element_area.find(".ingredient-editor.picture").selector)
Alchemy.fileEditors(".ingredient-editor.file, .ingredient-editor.audio, .ingredient-editor.video")
Alchemy.pictureEditors(".ingredient-editor.picture")
if @callback
@callback.call()
.fail (xhr, status, error) =>
Expand Down
9 changes: 4 additions & 5 deletions app/javascript/alchemy_admin/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ function init(scope) {
}

function initElement($el) {
var selector = `#${$el.attr("id")}`
Alchemy.ElementDirtyObserver($el)
init($el && $el.selector)
init(selector)
Alchemy.ImageLoader($el[0])
Alchemy.fileEditors(
$el.find(
".ingredient-editor.file, .ingredient-editor.audio, .ingredient-editor.video"
).selector
`${selector} .ingredient-editor.file, ${selector} .ingredient-editor.audio, ${selector} .ingredient-editor.video`
)
Alchemy.pictureEditors($el.find(".ingredient-editor.picture").selector)
Alchemy.pictureEditors(`${selector} .ingredient-editor.picture`)
}

export default {
Expand Down

0 comments on commit 044c7fc

Please sign in to comment.