+/* global wpPointerL10n */
/**
* Pointer jQuery widget.
*/
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 ) {
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 );
}
$.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();
}
},
dfd.done( function( content ) {
self._update( event, content );
- })
+ });
// Either o.content is a string...
if ( typeof o.content === 'string' ) {
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() );
}
}));
},
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++ );
},