~canonical-sysadmins/wordpress/4.5.2

« back to all changes in this revision

Viewing changes to wp-includes/js/wpdialog.js

  • Committer: Jacek Nykis
  • Date: 2015-01-05 16:17:05 UTC
  • Revision ID: jacek.nykis@canonical.com-20150105161705-w544l1h5mcg7u4w9
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
( function($) {
 
2
        $.widget('wp.wpdialog', $.ui.dialog, {
 
3
                open: function() {
 
4
                        // Add beforeOpen event.
 
5
                        if ( this.isOpen() || false === this._trigger('beforeOpen') ) {
 
6
                                return;
 
7
                        }
 
8
 
 
9
                        // Open the dialog.
 
10
                        this._super();
 
11
                        // WebKit leaves focus in the TinyMCE editor unless we shift focus.
 
12
                        this.element.focus();
 
13
                        this._trigger('refresh');
 
14
                }
 
15
        });
 
16
 
 
17
        $.wp.wpdialog.prototype.options.closeOnEscape = false;
 
18
 
 
19
})(jQuery);