Sha256: 3c39133119bd0aacafa0586bbe42f0c7a36d54e420568602f413178bca124e3b
Contents?: true
Size: 971 Bytes
Versions: 18
Compression:
Stored size: 971 Bytes
Contents
class Tenon.features.tenonContent.Editor constructor: -> $(document).on('cocoon:after-insert', '.tenon-content', @_rowInserted) $(document).on('cocoon:after-remove', '.tenon-content', @_rowRemoved) $(document).on('input keypress paste change', '.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
18 entries across 18 versions & 1 rubygems