fl-builder-user-templates-admin-edit.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ( function( $ ) {
  2. /**
  3. * Handles logic for the user templates admin edit interface.
  4. *
  5. * @class FLBuilderUserTemplatesAdminEdit
  6. * @since 1.10
  7. */
  8. FLBuilderUserTemplatesAdminEdit = {
  9. /**
  10. * Initializes the user templates admin edit interface.
  11. *
  12. * @since 1.10
  13. * @access private
  14. * @method _init
  15. */
  16. _init: function()
  17. {
  18. this._setupPageTitle();
  19. },
  20. /**
  21. * Adds to correct title to the edit screen and changes the
  22. * Add New button URL to point to our custom Add New page.
  23. *
  24. * @since 1.10
  25. * @access private
  26. * @method _setupPageTitle
  27. */
  28. _setupPageTitle: function()
  29. {
  30. var button = $( '.page-title-action' ),
  31. url = FLBuilderConfig.addNewURL + '&fl-builder-template-type=' + FLBuilderConfig.userTemplateType,
  32. h1 = $( '.wp-heading-inline' );
  33. h1.html( FLBuilderConfig.pageTitle + ' ' ).append( button );
  34. button.attr( 'href', url ).show();
  35. },
  36. };
  37. // Initialize
  38. $( function() { FLBuilderUserTemplatesAdminEdit._init(); } );
  39. } )( jQuery );