fl-builder-admin-posts-list.js 970 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. (function($){
  2. /**
  3. * Helper class for dealing with the post edit screen.
  4. *
  5. * @class FLBuilderAdminPostsListCount
  6. * @since 2.2.1
  7. * @static
  8. */
  9. FLBuilderAdminPostsListCount = {
  10. /**
  11. * Initializes the builder enabled count for the post edit screen.
  12. *
  13. * @since 2.2.1
  14. * @method init
  15. */
  16. init: function()
  17. {
  18. this._setupLink();
  19. },
  20. _setupLink: function() {
  21. var ul = $('ul.subsubsub')
  22. var count = window.fl_builder_enabled_count.count;
  23. var brand = window.fl_builder_enabled_count.brand;
  24. var clicked = window.fl_builder_enabled_count.clicked;
  25. var type = window.fl_builder_enabled_count.type;
  26. var bb_class = '';
  27. if ( clicked ) {
  28. bb_class += 'current'
  29. }
  30. ul.append( '|&nbsp;<li class="bb"><a class="' + bb_class + '" href="edit.php?post_type=' + type + '&bbsort">' + brand + ' <span class="count">(' + count +')</span></a></li>');
  31. }
  32. };
  33. $(function(){
  34. FLBuilderAdminPostsListCount.init()
  35. });
  36. })(jQuery);