Skip to content

Commit

Permalink
Fix EZP-20482: In IE8, "Enter" key does not work when creating a cust…
Browse files Browse the repository at this point in the history
…om tag
  • Loading branch information
dpobel committed Jun 6, 2013
1 parent c011882 commit aeb5c81
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -50,6 +50,8 @@ var eZOEPopupUtils = {
editorSelectedText: false,
// Same as above but with markup
editorSelectedHtml: false,
// the selected node in the editor, set on init
editorSelectedNode: false,
// generates class name for tr elements in browse / search / bookmark list
browseClassGenerator: function(){ return ''; },
// generates browse link for a specific mode
Expand Down Expand Up @@ -109,6 +111,7 @@ var eZOEPopupUtils = {
if ( jQuery.trim( selectedHtml ) !== '' )
s.editorSelectedHtml = selectedHtml;
}
s.editorSelectedNode = ed.selection.getNode();

if ( s.onInit && s.onInit.call )
s.onInit.call( eZOEPopupUtils, s.editorElement, s.tagName, ed );
Expand Down Expand Up @@ -308,7 +311,8 @@ var eZOEPopupUtils = {
*/
insertTagCleanly: function( ed, tag, content, args )
{
var edCurrentNode = ed.selection.getNode(), newElement = edCurrentNode.ownerDocument.createElement( tag );
var edCurrentNode = eZOEPopupUtils.settings.editorSelectedNode ? eZOEPopupUtils.settings.editorSelectedNode : ed.selection.getNode(),
newElement = edCurrentNode.ownerDocument.createElement( tag );
if ( tag !== 'img' ) newElement.innerHTML = content;

if ( edCurrentNode.nodeName === 'TD' )
Expand Down

0 comments on commit aeb5c81

Please sign in to comment.