jquery.geocomplete.js
function(){
      if (!this.options.details){ return; }

      if(this.options.detailsScope) {
        var $details = $(this.input).parents(this.options.detailsScope).find(this.options.details);
      } else {
        var $details = $(this.options.details);
      }

      var attribute = this.options.detailsAttribute,
        details = {};

      function setDetail(value){
        details[value] = $details.find("[" +  attribute + "=" + value + "]");
      }

      $.each(componentTypes, function(index, key){
        setDetail(key);
        setDetail(key + "_short");
      });

      $.each(placesDetails, function(index, key){
        setDetail(key);
      });

      this.$details = $details;
      this.details = details;
    }
function(){
      if (!this.options.details){ return; }

      if(this.options.detailsScope) {
        var $details = $(this.input).parents(this.options.detailsScope).find(this.options.details);
      } else {
        var $details = $(this.options.details);
      }

      var attribute = this.options.detailsAttribute,
        details = {};

      function setDetail(value){
        details[value] = $details.find("[" +  attribute + "=" + value + "]");
      }

      $.each(componentTypes, function(index, key){
        setDetail(key);
        setDetail(key + "_short");
      });

      $.each(placesDetails, function(index, key){
        setDetail(key);
      });

      this.$details = $details;
      this.details = details;
    }
function ( ) { if ( ! this . options . details ) { return ; } if ( this . options . detailsScope ) { var $details = $ ( this . input ) . parents ( this . options . detailsScope ) . find ( this . options . details ) ; } else { var $details = $ ( this . options . details ) ; } var attribute = this . options . detailsAttribute , details = { } ; function setDetail ( value ) { details [ value ] = $details . find ( "[" + attribute + "=" + value + "]" ) ; } $ . each ( componentTypes , function ( index , key ) { setDetail ( key ) ; setDetail ( key + "_short" ) ; } ) ; $ . each ( placesDetails , function ( index , key ) { setDetail ( key ) ; } ) ; this . $details = $details ; this . details = details ; }
Prepare a given DOM structure to be populated when we got some data. This will cycle through the list of component types and map the corresponding elements.
Prepare a given DOM structure to be populated when we got some data . This will cycle through the list of component types and map the corresponding elements .