Changeset 20745
- Timestamp:
- 05/09/2012 12:23:05 AM (13 years ago)
- Location:
- trunk/wp-includes/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/customize-base.dev.js
r20645 r20745 470 470 message = JSON.parse( event.data ); 471 471 472 if ( message && message.id && message.data&& this.topics[ message.id ] )472 if ( message && message.id && typeof message.data !== 'undefined' && this.topics[ message.id ] ) 473 473 this.topics[ message.id ].fireWith( this, [ message.data ]); 474 474 }, … … 477 477 var message; 478 478 479 data = data || {};479 data = typeof data === 'undefined' ? {} : data; 480 480 481 481 if ( ! this.url() ) -
trunk/wp-includes/js/customize-controls.dev.js
r20741 r20745 312 312 api.Messenger.prototype.initialize.call( this, params.url ); 313 313 314 this.scroll = 0; 315 this.bind( 'scroll', function( distance ) { 316 this.scroll = distance; 317 }); 318 314 319 // We're dynamically generating the iframe, so the origin is set 315 320 // to the current window's location, not the url's. … … 336 341 if ( this.iframe ) 337 342 this.iframe.remove(); 343 338 344 this.iframe = this.loading; 339 345 delete this.loading; 340 346 341 347 this.targetWindow( this.iframe[0].contentWindow ); 348 this.send( 'scroll', this.scroll ); 342 349 }, 343 350 query: function() {}, -
trunk/wp-includes/js/customize-preview.dev.js
r20741 r20745 1 1 (function( exports, $ ){ 2 var api = wp.customize; 2 var api = wp.customize, 3 debounce; 4 5 debounce = function( fn, delay, context ) { 6 var timeout; 7 return function() { 8 var args = arguments; 9 10 context = context || this; 11 12 clearTimeout( timeout ); 13 timeout = setTimeout( function() { 14 timeout = null; 15 fn.apply( context, args ); 16 }, delay ); 17 }; 18 }; 3 19 4 20 api.Preview = api.Messenger.extend({ … … 27 43 this.body.on( 'submit.preview', 'form', function( event ) { 28 44 event.preventDefault(); 45 }); 46 47 this.window = $( window ); 48 this.window.on( 'scroll.preview', debounce( function() { 49 self.send( 'scroll', self.window.scrollTop() ); 50 }, 200 )); 51 52 this.bind( 'scroll', function( distance ) { 53 self.window.scrollTop( distance ); 29 54 }); 30 55 }
Note: See TracChangeset
for help on using the changeset viewer.