Sha256: e1fcac03286656c4269f1fc8f224562328177c0cdbb4994b62a4f5c022ba2d0e

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

$(document).ready ->
  
  ## Notification Preview
  $('#kublog .submit_fancybox').fancybox
	  showCloseButton: false
	  hideOnOverlayClick: false
	  onComplete: ->
	    textarea_html = $('#post_email_body').parent().html()
	    $('#post_email_body').data('prewysiwyg', textarea_html)
	    $('#post_email_body').wysiwyg(wysiwyg.email_controls)
	  onClosed: -> 
	    $('form.post_form').submit() if $('#post_email_body').data('ready')?
	    textarea_html = $('#post_email_body').data('prewysiwyg')
	    $('#post_email_body').parent().html(textarea_html)
      
  ## Calls Lightbox if User still decides to notify via E-mail
  $('#kublog .post_form').submit ->
    if $('#post_email_notify').attr('checked')? && not $('#post_email_body').data('ready')
      $('#post_email_body').val($(this).data('post').email_body)
      $('#link-to-email-template').click()
      return false
    else
      return true

  ## Confirms Notification text and readies for submission
  $('#kublog #email_submit').click ->
    $('#post_email_body').data('ready', true)
    $.fancybox.close()

  ## Aborts notification Submission
  $('#kublog #email_cancel').click ->
    $.fancybox.close()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kublog-0.0.1.1 app/assets/javascripts/kublog/email.js.coffee