Skip to content

Instantly share code, notes, and snippets.

@dcsaszar
Last active September 7, 2015 17:23
Show Gist options
  • Save dcsaszar/a2729ba2e04d56dd79b9 to your computer and use it in GitHub Desktop.
Save dcsaszar/a2729ba2e04d56dd79b9 to your computer and use it in GitHub Desktop.
scrivito.on 'content', (content) ->
if scrivito.in_editable_view()
$(content).find('''
[data-scrivito-field-type=stringlist]:not([data-editor]),
[data-editor~=stringlist]
''').each -> # ...
scrivito.define_editor "stringlist",
can_edit: (dom_element) -> $(dom_element).data("scrivito-field-type") == "stringlist"
edit: (dom_element) -> # ...
scrivito.select_editor (element, editor) ->
if $(element).data("editor") == "slider"
editor.use "slider"
if $(element).data("editor") == "redactor"
editor.use "redactor"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment