X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/42aebe6945a3a60c8f73853bea2c8b202d64a20b..256a3b381f63716209b3527d0a14442ae570c283:/wp-includes/js/wp-pointer.js diff --git a/wp-includes/js/wp-pointer.js b/wp-includes/js/wp-pointer.js index 23b0e43d..4cea390e 100644 --- a/wp-includes/js/wp-pointer.js +++ b/wp-includes/js/wp-pointer.js @@ -1,3 +1,4 @@ +/* global wpPointerL10n */ /** * Pointer jQuery widget. */ @@ -5,11 +6,11 @@ var identifier = 0, zindex = 9999; - $.widget("wp.pointer", { + $.widget('wp.pointer', { options: { pointerClass: 'wp-pointer', pointerWidth: 320, - content: function( respond, event, t ) { + content: function() { return $(this).text(); }, buttons: function( event, t ) { @@ -60,11 +61,11 @@ tip = this.pointer; // Handle document transfer - if ( key === "document" && value !== o.document ) { + if ( key === 'document' && value !== o.document ) { tip.detach().appendTo( value.body ); // Handle class change - } else if ( key === "pointerClass" ) { + } else if ( key === 'pointerClass' ) { tip.removeClass( o.pointerClass ).addClass( value ); } @@ -72,11 +73,11 @@ $.Widget.prototype._setOption.apply( this, arguments ); // Reposition automatically - if ( key === "position" ) { + if ( key === 'position' ) { this.reposition(); // Update content automatically if pointer is open - } else if ( key === "content" && this.active ) { + } else if ( key === 'content' && this.active ) { this.update(); } }, @@ -101,7 +102,7 @@ dfd.done( function( content ) { self._update( event, content ); - }) + }); // Either o.content is a string... if ( typeof o.content === 'string' ) { @@ -235,11 +236,11 @@ this.active = true; - this._trigger( "open", event, this._handoff() ); + this._trigger( 'open', event, this._handoff() ); - this._trigger( "show", event, this._handoff({ + this._trigger( 'show', event, this._handoff({ opened: function() { - self._trigger( "opened", event, self._handoff() ); + self._trigger( 'opened', event, self._handoff() ); } })); }, @@ -251,15 +252,15 @@ var self = this; this.active = false; - this._trigger( "close", event, this._handoff() ); - this._trigger( "hide", event, this._handoff({ + this._trigger( 'close', event, this._handoff() ); + this._trigger( 'hide', event, this._handoff({ closed: function() { - self._trigger( "closed", event, self._handoff() ); + self._trigger( 'closed', event, self._handoff() ); } })); }, - sendToTop: function( event ) { + sendToTop: function() { if ( this.active ) this.pointer.css( 'z-index', zindex++ ); },