Sha256: 492033ff071b9f24e062732a15f4a8b76c7a122177a2c79a0222d51148ab73cc

Contents?: true

Size: 1.86 KB

Versions: 2

Compression:

Stored size: 1.86 KB

Contents

$(document).ready(function() {
  $('div.tabs li a').click(function() {
    var tabs = $(this).closest('div');
    $('div.active, li.active', tabs).removeClass('active')
    // activate selected tab and tab content
    $(this).closest('li').addClass('active');
    selected = '#tab_' + $(this).attr('href').replace('#', '');
    $(selected).addClass('active');
  });

  $('#toggle_draft').click(function() {
    if($(this).attr('checked')) {
      $('#publish_date_wrapper').hide();
    } else {
      $('#publish_date_wrapper').show();
    }
  });

  $('.hint').each(function() {
    if(!$(this).hasClass('text_only')) {
      var label = $('label[for=' + this.getAttribute('for') + ']');

      if(label) {
        $(this).appendTo(label).addClass('move_up');
      }

      $(this).addClass('enabled');
    }
  });

  $('.hint.enabled').each(function() {
    $(this).qtip({
      content: $(this).html(),
      position: {
        corner: {
          target:  'topMiddle',
          tooltip: 'bottomMiddle'
        },
        adjust: {
          screen: true,
          scroll: true
        }
      },
      // FIXME tip option for qtip is broken currently on firefox, add this when this is fixed: tip: 'bottomMiddle'
      style: {
        background: '#FBF7E4',
        color: '#black',
        name: 'cream',
        border: {
          width: 3,
          radius: 5,
          color: '#DDDDDD'
        }
      },
      show: {
        delay: 0,
        when: {
          event: 'click'
        }
      },
      hide: {
        when: {
          event: 'unfocus'
        },
        effect: {
          length: 1000
        }
      }
    });
  });

  // TODO make the new section creation maybe a two-step form and get rid of this here...
  $('form.section_type input[type=submit]').hide();
  $('form.section_type input[type=radio]').change(function(e) {
    $('form.section_type').submit();
  })
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adva-core-0.0.2 public/javascripts/backup/admin/jquery.admin.js
adva-core-0.0.1 public/javascripts/backup/admin/jquery.admin.js