Skip to content

Commit

Permalink
TinyMCE: add support for IE11.
Browse files Browse the repository at this point in the history
- Add the latest changes from the 3.x branch upstream.
- Reduce the number of calls to tinyMCEPopup.restoreSelection() in our custom plugins.
- Remove the deprecated execCommand("mceBeginUndoLevel");.
See #25281.
Built from https://develop.svn.wordpress.org/trunk@25748


git-svn-id: http://core.svn.wordpress.org/trunk@25661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
azaozz committed Oct 9, 2013
1 parent 34da946 commit 65cd133
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 20 deletions.
14 changes: 9 additions & 5 deletions wp-includes/js/tinymce/plugins/wpdialogs/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ var tinyMCEPopup = {
restoreSelection : function() {
var t = tinyMCEPopup;

if (!t.isWindow && tinymce.isIE)
if (!t.isWindow && tinymce.isIE) {
t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
}
},

/**
Expand Down Expand Up @@ -280,11 +281,12 @@ var tinyMCEPopup = {

// Internal functions

_restoreSelection : function() {
var e = window.event.srcElement;
_restoreSelection : function(e) {
var el = e && e.target ? e.target : window.event.srcElement;

if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
if ( el.nodeName == 'INPUT' && ( el.type == 'submit' || el.type == 'button' ) ) {
tinyMCEPopup.restoreSelection();
}
},

/* _restoreSelection : function() {
Expand Down Expand Up @@ -325,11 +327,13 @@ var tinyMCEPopup = {
document.body.style.display = '';

// Restore selection in IE when focus is placed on a non textarea or input element of the type text
if (tinymce.isIE) {
if ( tinymce.isIE && ! tinymce.isIE11 ) {
document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);

// Add base target element for it since it would fail with modal dialogs
t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'});
} else if ( tinymce.isIE11 ) {
document.addEventListener('mouseup', tinyMCEPopup._restoreSelection, false);
}

t.restoreSelection();
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/tinymce/plugins/wpdialogs/js/popup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ wpImage = {
ed.selection.moveToBookmark(b);
}

tinyMCEPopup.execCommand("mceEndUndoLevel");
ed.execCommand("mceEndUndoLevel");
ed.execCommand('mceRepaint');
tinyMCEPopup.close();
},
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/tinymce/tiny_mce.js

Large diffs are not rendered by default.

Loading

0 comments on commit 65cd133

Please sign in to comment.