Make WordPress Core

Changeset 22514


Ignore:
Timestamp:
11/09/2012 10:36:35 PM (12 years ago)
Author:
nacin
Message:

WordPress dialog jQuery UI widget:

  • Link to the upstream bug report.
  • No need to specify the default value for an option.
  • Use the new _super() UI method to open the dialog, avoiding a direct reference to the parent.
  • Fix typo in comment.
  • Use public isOpen() method rather than a private property.

props scott.gonzalez.
fixes #22399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js

    r22513 r22514  
    11(function($){
    22    $.ui.dialog.prototype.options.closeOnEscape = false;
    3     $.widget("wp.wpdialog", $.ui.dialog, {
    4         options: {
    5             closeOnEscape: false
    6         },
     3    $.widget('wp.wpdialog', $.ui.dialog, {
     4        // Work around a bug in jQuery UI 1.9.1.
     5        // http://bugs.jqueryui.com/ticket/8805
    76        widgetEventPrefix: 'wpdialog',
    87
     
    109            var ed;
    1110
    12             // Initialize tinyMCEPopup if it exists and is the editor is active.
     11            // Initialize tinyMCEPopup if it exists and the editor is active.
    1312            if ( tinyMCEPopup && typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
    1413                tinyMCEPopup.init();
     
    1615
    1716            // Add beforeOpen event.
    18             if ( this._isOpen || false === this._trigger('beforeOpen') ) {
     17            if ( this.isOpen() || false === this._trigger('beforeOpen') ) {
    1918                return;
    2019            }
    2120
    2221            // Open the dialog.
    23             $.ui.dialog.prototype.open.apply( this, arguments );
     22            this._super();
    2423            // WebKit leaves focus in the TinyMCE editor unless we shift focus.
    2524            this.element.focus();
Note: See TracChangeset for help on using the changeset viewer.