Sha256: 9b9bdb8f75e664a08a49fd0248916a611a0affb4fef844f22ae6ec7a21bc57b5
Contents?: true
Size: 929 Bytes
Versions: 23
Compression:
Stored size: 929 Bytes
Contents
class Tenon.features.tenonContent.Editor constructor: -> $('.tenon-content').on('cocoon:after-insert', @_rowInserted) $('.tenon-content').on('cocoon:after-remove', @_rowRemoved) $(document).on('input', '.editable-text', @_contentUpdated) for div in $('.tn-tc') @_updateButtons($(div)) _rowInserted: (e) => Tenon.mediumEditor.deactivate() new Tenon.features.Medium @_updateButtons($(e.currentTarget).closest('.tn-tc')) _rowRemoved: (e) => @_updateButtons($(e.currentTarget).closest('.tn-tc')) _contentUpdated: (e) => $editable = $(e.currentTarget) $editable.next('input[type=hidden]').val($editable.html()) _updateButtons: ($wrap)=> if $wrap.find('.tn-tc-row:visible').length == 0 $wrap.find('.tn-tc-add-content').show() $wrap.find('.tn-tc-pop-out').hide() else $wrap.find('.tn-tc-add-content').hide() $wrap.find('.tn-tc-pop-out').show()
Version data entries
23 entries across 23 versions & 1 rubygems