Sha256: 6db1fa728f6a7ad659b6a4c75d03a19df4b54bdcf8cb7d3dbafc4fd42ceaff10

Contents?: true

Size: 1.93 KB

Versions: 16

Compression:

Stored size: 1.93 KB

Contents

$(document).ready(function() {

  $("#cms_page_pagetype").change(function() {
    item = $('#cms_page_pagetype :selected').text();
    switch (item) {
      case 'content':
      case 'divider':
        $("#pagetype_link").hide();
        break;
      case 'pagelink':
      case 'link':
      case 'controller/action':
        $("#pagetype_link").show();
        break;
      default:
        break;
    }
  });
  $("#cms_page_pagetype").change(); // initially run on page load

  // When a link is selected in a bootstrap dropdown menu, set the
  // associated text field with the text
  //
  // <button class="btn dropdown-toggle" data-toggle="dropdown" >Folder</button>
  // <ul class="dropdown-menu dropdown-field" data-field="test">
  //   <li><a href="#"><i class="font-heart"></i>Favorite it</a></li>
  // </ul>
  // <input id="test" type="text">
  //----------------------------------------------------------------
  $(".dropdown-field li a").click(function(){
    $("#" + $(this).parent().parent().data("field")).val( $(this).text() )
  });
  
  //----------------------------------------------------------------
  $('#blog_user_table').dataTable( {
     bJQueryUI: false,
     bAutoWidth: false,
     sPaginationType: 'full_numbers',
     iDisplayLength: 10,
     bProcessing: false,
     bServerSide: true,
     bStateSave: false,
     aaSorting: [[0, 'asc']],
     sDom: '<"datatable-header"f>t<"datatable-footer">',
     oLanguage: {
       sLengthMenu: "<span>Show entries:</span> _MENU_"
     },
     sAjaxSource: $('#blog_user_table').data('source')
  });
  
  // Set the height of the tag reference modal panes, so they scroll like we want
  //----------------------------------------------------------------------
  $('#tag_reference').on('show.bs.modal', function () {
      $('.modal .modal-body .tag_details').css('max-height', $(window).height() * 0.7);
      $('.modal .modal-body .tag_nav').css('max-height', $(window).height() * 0.7);
  });
  
});

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_cms-4.2.3.10 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.9 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.8 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.7 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.6 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.5 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.4 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.3 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.2 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3.1 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.3 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.2.3 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.2.2 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.2.1 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.2 app/assets/javascripts/dm_cms/admin.js
dm_cms-4.2.1.5 app/assets/javascripts/dm_cms/admin.js