Sha256: 8252cb8b6bd41c0dc902f76f4dc27be9bf3c9d7d2ee51b5d278ad947b184accf
Contents?: true
Size: 981 Bytes
Versions: 24
Compression:
Stored size: 981 Bytes
Contents
scrivito.on 'content', (content) -> return unless scrivito.in_editable_view() fields = $(content).find('[data-scrivito-field-type=binary]:not([data-editor])') scrivito.editors._file_dropzone fields, (el, file) -> el.scrivito('save', file).then(-> el.scrivito('reload')), 'image-editor-dragover' fields.filter('[data-scrivito-editors-allow-delete]').each -> setup_delete_btn $(this) setup_delete_btn = (el) -> return unless el.scrivito('content') container = if el.prop('tagName') is 'IMG' css_class = 'scrivito-editor-image-container' el.wrap("<div class=#{css_class}></div>") unless el.parent(".#{css_class}").length el.parent(".#{css_class}") else el return if container.find('.delete-binary').length $("<a href=# class='delete-binary editing-button editing-red delete'> <i class='editing-icon editing-icon-trash'></i></a>") .prependTo(container) .click -> el.scrivito('save', null).then(-> el.scrivito('reload')) and off
Version data entries
24 entries across 24 versions & 1 rubygems