// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

$().ready(function () {
  $('form.tandem_content_editor').on('ajax:success', function(event, content, status, jqXHR){
    $.get(parent.location.href, function(data, status, jqXHR){
      var content_id = '#' + content.tag;

      $(content_id, parent.document).html( $(content_id, data).html() );
      parent.$.fn.colorbox.close();
    });
  });

  $('.wymeditor').wymeditor({ wymPath: '/assets/tandem/wymeditor/' });

  $('h3.settings-toggle').live('click', function () {
    $('div.advanced-settings').slideToggle('slow');
  });
});

// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

$().ready(function () {
  $('form.tandem_content_editor').on('ajax:success', function(event, content, status, jqXHR){
    $.get(parent.location.href, function(data, status, jqXHR){
      var content_id = '#' + content.tag;

      $(content_id, parent.document).html( $(content_id, data).html() );
      parent.$.fn.colorbox.close();
    });
  });

  $('.wymeditor').wymeditor({ wymPath: '/assets/tandem/wymeditor/jquery.wymeditor.min.js',
                              basePath: '/assets/tandem/wymeditor/',
                              skinPath: "/assets/tandem/wymeditor/skins/default/",
                              jQueryPath: "/assets/jquery.js"
  });

  $('h3.settings-toggle').live('click', function () {
    $('div.advanced-settings').slideToggle('slow');
  });
});

Set explicit WYMEditor paths, since wymeditor is compiled into the tandem bundle and therefore WYMEditor's auto path compute methods fail, since it can't find a script tag it thinks it should expect.