formTemplateCollection.js 838 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Collection that holds our form models.
  3. *
  4. * @package Ninja Forms client
  5. * @copyright (c) 2017 WP Ninjas
  6. * @since 3.0
  7. */
  8. define( ['models/formTemplateModel'], function( TemplateModel ) {
  9. var collection = Backbone.Collection.extend( {
  10. model: TemplateModel,
  11. tmpNum: 1,
  12. url: function() {
  13. return ajaxurl + "?action=nf_new_form_templates";
  14. },
  15. parse: function( response, options ){
  16. return response.data;
  17. },
  18. initialize: function() {
  19. this.fetch( {
  20. success: function(response) {
  21. // This section intentionally left blank.
  22. },
  23. error: function(response) {
  24. // This section intentionally left blank.
  25. },
  26. });
  27. }
  28. } );
  29. return collection;
  30. } );