vendor/ember-leaflet-cartodb/cartodb_noleaflet.js
function() {

    if(this.template) {

      // If there is content, destroy the jscrollpane first, then remove the content.
      var $jscrollpane = this.$(".cartodb-popup-content");
      if ($jscrollpane.length > 0 && $jscrollpane.data() != null) {
        $jscrollpane.data().jsp && $jscrollpane.data().jsp.destroy();
      }

      // Clone fields and template name
      var fields = _.map(this.model.attributes.content.fields, function(field){
        return _.clone(field);
      });
      var data = this.model.get('content') ? this.model.get('content').data : {};

      // If a custom template is not applied, let's sanitized
      // fields for the template rendering
      if (this.model.get('template_name')) {
        var template_name = _.clone(this.model.attributes.template_name);

        // Sanitized them
        fields = this._fieldsToString(fields, template_name);
      }

      // Join plan fields values with content to work with
      // custom infowindows and CartoDB infowindows.
      var values = {};
      _.each(this.model.get('content').fields, function(pair) {
        values[pair.title] = pair.value;
      })

      var obj = _.extend({
          content: {
            fields: fields,
            data: data
          }
        },values);

      this.$el.html(
        cdb.core.sanitize.html(this.template(obj), this.model.get('sanitizeTemplate'))
      );

      // Set width and max-height from the model only
      // If there is no width set, we don't force our infowindow
      if (this.model.get('width')) {
        this.$('.cartodb-popup').css('width', this.model.get('width') + 'px');
      }
      this.$('.cartodb-popup .cartodb-popup-content').css('max-height', this.model.get('maxHeight') + 'px');

      // Hello jscrollpane hacks!
      // It needs some time to initialize, if not it doesn't render properly the fields
      // Check the height of the content + the header if exists
      var self = this;
      setTimeout(function() {
        var actual_height = self.$(".cartodb-popup-content").outerHeight();
        if (self.model.get('maxHeight') <= actual_height)
          self.$(".cartodb-popup-content").jScrollPane({
            verticalDragMinHeight: 20,
            autoReinitialise: true
          });
      }, 1);

      // If the infowindow is loading, show spin
      this._checkLoading();

      // If the template is 'cover-enabled', load the cover
      this._loadCover();

      if(!this.isLoadingData()) {
        this.model.trigger('domready', this, this.$el);
        this.trigger('domready', this, this.$el);
      }
    }

    return this;
  }
function() {

    if(this.template) {

      // If there is content, destroy the jscrollpane first, then remove the content.
      var $jscrollpane = this.$(".cartodb-popup-content");
      if ($jscrollpane.length > 0 && $jscrollpane.data() != null) {
        $jscrollpane.data().jsp && $jscrollpane.data().jsp.destroy();
      }

      // Clone fields and template name
      var fields = _.map(this.model.attributes.content.fields, function(field){
        return _.clone(field);
      });
      var data = this.model.get('content') ? this.model.get('content').data : {};

      // If a custom template is not applied, let's sanitized
      // fields for the template rendering
      if (this.model.get('template_name')) {
        var template_name = _.clone(this.model.attributes.template_name);

        // Sanitized them
        fields = this._fieldsToString(fields, template_name);
      }

      // Join plan fields values with content to work with
      // custom infowindows and CartoDB infowindows.
      var values = {};
      _.each(this.model.get('content').fields, function(pair) {
        values[pair.title] = pair.value;
      })

      var obj = _.extend({
          content: {
            fields: fields,
            data: data
          }
        },values);

      this.$el.html(
        cdb.core.sanitize.html(this.template(obj), this.model.get('sanitizeTemplate'))
      );

      // Set width and max-height from the model only
      // If there is no width set, we don't force our infowindow
      if (this.model.get('width')) {
        this.$('.cartodb-popup').css('width', this.model.get('width') + 'px');
      }
      this.$('.cartodb-popup .cartodb-popup-content').css('max-height', this.model.get('maxHeight') + 'px');

      // Hello jscrollpane hacks!
      // It needs some time to initialize, if not it doesn't render properly the fields
      // Check the height of the content + the header if exists
      var self = this;
      setTimeout(function() {
        var actual_height = self.$(".cartodb-popup-content").outerHeight();
        if (self.model.get('maxHeight') <= actual_height)
          self.$(".cartodb-popup-content").jScrollPane({
            verticalDragMinHeight: 20,
            autoReinitialise: true
          });
      }, 1);

      // If the infowindow is loading, show spin
      this._checkLoading();

      // If the template is 'cover-enabled', load the cover
      this._loadCover();

      if(!this.isLoadingData()) {
        this.model.trigger('domready', this, this.$el);
        this.trigger('domready', this, this.$el);
      }
    }

    return this;
  }
function ( ) { if ( this . template ) { // If there is content, destroy the jscrollpane first, then remove the content. var $jscrollpane = this . $ ( ".cartodb-popup-content" ) ; if ( $jscrollpane . length > 0 && $jscrollpane . data ( ) != null ) { $jscrollpane . data ( ) . jsp && $jscrollpane . data ( ) . jsp . destroy ( ) ; } // Clone fields and template name var fields = _ . map ( this . model . attributes . content . fields , function ( field ) { return _ . clone ( field ) ; } ) ; var data = this . model . get ( 'content' ) ? this . model . get ( 'content' ) . data : { } ; // If a custom template is not applied, let's sanitized // fields for the template rendering if ( this . model . get ( 'template_name' ) ) { var template_name = _ . clone ( this . model . attributes . template_name ) ; // Sanitized them fields = this . _fieldsToString ( fields , template_name ) ; } // Join plan fields values with content to work with // custom infowindows and CartoDB infowindows. var values = { } ; _ . each ( this . model . get ( 'content' ) . fields , function ( pair ) { values [ pair . title ] = pair . value ; } ) var obj = _ . extend ( { content : { fields : fields , data : data } } , values ) ; this . $el . html ( cdb . core . sanitize . html ( this . template ( obj ) , this . model . get ( 'sanitizeTemplate' ) ) ) ; // Set width and max-height from the model only // If there is no width set, we don't force our infowindow if ( this . model . get ( 'width' ) ) { this . $ ( '.cartodb-popup' ) . css ( 'width' , this . model . get ( 'width' ) + 'px' ) ; } this . $ ( '.cartodb-popup .cartodb-popup-content' ) . css ( 'max-height' , this . model . get ( 'maxHeight' ) + 'px' ) ; // Hello jscrollpane hacks! // It needs some time to initialize, if not it doesn't render properly the fields // Check the height of the content + the header if exists var self = this ; setTimeout ( function ( ) { var actual_height = self . $ ( ".cartodb-popup-content" ) . outerHeight ( ) ; if ( self . model . get ( 'maxHeight' ) <= actual_height ) self . $ ( ".cartodb-popup-content" ) . jScrollPane ( { verticalDragMinHeight : 20 , autoReinitialise : true } ) ; } , 1 ) ; // If the infowindow is loading, show spin this . _checkLoading ( ) ; // If the template is 'cover-enabled', load the cover this . _loadCover ( ) ; if ( ! this . isLoadingData ( ) ) { this . model . trigger ( 'domready' , this , this . $el ) ; this . trigger ( 'domready' , this , this . $el ) ; } } return this ; }
Render infowindow content
Render infowindow content