Changeset 23389
- Timestamp:
- 02/06/2013 07:10:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/heartbeat.js
r23382 r23389 32 32 if ( typeof( window.heartbeatSettings != 'undefined' ) ) { 33 33 settings = $.extend( {}, window.heartbeatSettings ); 34 delete window.heartbeatSettings;34 window.heartbeatSettings = null; 35 35 36 36 // Add private vars … … 62 62 63 63 return (new Date()).getTime(); 64 } 65 66 function isLocalFrame(frame) { 67 try { 68 if ( frame.contentWindow.document ) 69 return true; 70 } catch(e) {} 71 72 return false; 64 73 } 65 74 … … 188 197 function setFrameEvents() { 189 198 $('iframe').each( function(i, frame){ 199 if ( !isLocalFrame(frame) ) 200 return; 201 190 202 if ( $.data(frame, 'wp-heartbeat-focus') ) 191 203 return; … … 207 219 }).on('focus.wp-heartbeat-focus', function(){ 208 220 $('iframe').each( function(i, frame){ 221 if ( !isLocalFrame(frame) ) 222 return; 223 209 224 $.removeData(frame, 'wp-heartbeat-focus'); 210 225 $(frame.contentWindow).off('.wp-heartbeat-focus'); … … 218 233 $(document).off('.wp-heartbeat-active'); 219 234 $('iframe').each( function(i, frame){ 235 if ( !isLocalFrame(frame) ) 236 return; 237 220 238 $(frame.contentWindow).off('.wp-heartbeat-active'); 221 239 }); … … 244 262 $(document).on('mouseover.wp-heartbeat-active keyup.wp-heartbeat-active', function(){ userIsActive(); }); 245 263 $('iframe').each( function(i, frame){ 264 if ( !isLocalFrame(frame) ) 265 return; 266 246 267 $(frame.contentWindow).on('mouseover.wp-heartbeat-active keyup.wp-heartbeat-active', function(){ userIsActive(); }); 247 268 });
Note: See TracChangeset
for help on using the changeset viewer.