github.com/qubitproducts/logspray@v0.2.14/server/swagger-ui/src/main/javascript/view/PopupView.js (about)

     1  'use strict';
     2  
     3  SwaggerUi.Views.PopupView = Backbone.View.extend({
     4      events: {
     5          'click .api-popup-cancel': 'cancelClick'
     6      },
     7  
     8      template: Handlebars.templates.popup,
     9      className: 'api-popup-dialog',
    10  
    11      selectors: {
    12          content: '.api-popup-content',
    13          main   : '#swagger-ui-container'
    14      },
    15  
    16      initialize: function(){
    17          this.$el.html(this.template(this.model));
    18      },
    19  
    20      render: function () {
    21          this.$(this.selectors.content).append(this.model.content);
    22          $(this.selectors.main).first().append(this.el);
    23          this.showPopup();
    24  
    25          return this;
    26      },
    27  
    28      showPopup: function () {
    29          this.$el.show();
    30      },
    31  
    32      cancelClick: function () {
    33          this.remove();
    34      }
    35  
    36  });