Ignore:
Timestamp:
Jun 24, 2013, 3:20:40 PM (11 years ago)
Author:
plg
Message:

feature 2885: forgotten jQuery(document).ready

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/history.tpl

    r23151 r23497  
    139139
    140140{footer_script}{literal}
    141 jQuery(".IP").one( "mouseenter", function(){
    142         var that = $(this);
    143         that
    144                 .data("isOver", true)
    145                 .one("mouseleave", function() {
    146                         that.removeData("isOver");
    147                 });
    148         GeoIp.get( that.text(), function(data) {
    149                 if (!data.fullName) return;
    150 
    151     var content = data.fullName;
    152     if (data.latitude && data.region_name) {
    153       content += '<br><a class="ipGeoOpen" data-lat="'+data.latitude+'" data-lon="'+data.longitude+'"';
    154       content += ' href="#">show on a Google Map</a>';
    155     }
    156 
    157                 that.tipTip( {
    158                         content: content,
    159       keepAlive: true,
    160       defaultPosition: "right",
    161       maxWidth: 320,
    162                         }       );
    163                 if (that.data("isOver"))
    164                         that.trigger("mouseenter");
    165         });
    166 } );
    167 
    168 jQuery(document).on('click', '.ipGeoOpen',  function() {
    169   var lat = jQuery(this).data("lat");
    170   var lon = jQuery(this).data("lon");
    171   var parent = jQuery(this).parent();
    172   jQuery(this).remove();
    173 
    174   var append = '<br><img width=300 height=220 src="http://maps.googleapis.com/maps/api/staticmap';
    175   append += '?sensor=false&size=300x220&zoom=6&markers=size:tiny%7C' + lat + ',' + lon + '">';
    176 
    177   jQuery(parent).append(append);
    178   return false;
     141jQuery(document).ready( function() {
     142  jQuery(".IP").one( "mouseenter", function(){
     143        var that = $(this);
     144        that
     145                .data("isOver", true)
     146                .one("mouseleave", function() {
     147                        that.removeData("isOver");
     148                });
     149        GeoIp.get( that.text(), function(data) {
     150                if (!data.fullName) return;
     151 
     152      var content = data.fullName;
     153      if (data.latitude && data.region_name) {
     154        content += '<br><a class="ipGeoOpen" data-lat="'+data.latitude+'" data-lon="'+data.longitude+'"';
     155        content += ' href="#">show on a Google Map</a>';
     156      }
     157 
     158                that.tipTip( {
     159                        content: content,
     160        keepAlive: true,
     161        defaultPosition: "right",
     162        maxWidth: 320,
     163                        }       );
     164                if (that.data("isOver"))
     165                        that.trigger("mouseenter");
     166        });
     167  } );
     168 
     169  jQuery(document).on('click', '.ipGeoOpen',  function() {
     170    var lat = jQuery(this).data("lat");
     171    var lon = jQuery(this).data("lon");
     172    var parent = jQuery(this).parent();
     173    jQuery(this).remove();
     174 
     175    var append = '<br><img width=300 height=220 src="http://maps.googleapis.com/maps/api/staticmap';
     176    append += '?sensor=false&size=300x220&zoom=6&markers=size:tiny%7C' + lat + ',' + lon + '">';
     177 
     178    jQuery(parent).append(append);
     179    return false;
     180  });
    179181});
    180182{/literal}{/footer_script}
Note: See TracChangeset for help on using the changeset viewer.