includes/clientside/tinymce/themes/advanced/js/image.js
changeset 543 dffcbfbc4e59
parent 459 31c23016ab62
equal deleted inserted replaced
542:5841df0ab575 543:dffcbfbc4e59
    52 	},
    52 	},
    53 
    53 
    54 	update : function() {
    54 	update : function() {
    55 		var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
    55 		var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
    56 
    56 
       
    57 		tinyMCEPopup.restoreSelection();
       
    58 
    57 		if (f.src.value === '') {
    59 		if (f.src.value === '') {
    58 			if (ed.selection.getNode().nodeName == 'IMG') {
    60 			if (ed.selection.getNode().nodeName == 'IMG') {
    59 				ed.dom.remove(ed.selection.getNode());
    61 				ed.dom.remove(ed.selection.getNode());
    60 				ed.execCommand('mceRepaint');
    62 				ed.execCommand('mceRepaint');
    61 			}
    63 			}
    84 		el = ed.selection.getNode();
    86 		el = ed.selection.getNode();
    85 
    87 
    86 		if (el && el.nodeName == 'IMG') {
    88 		if (el && el.nodeName == 'IMG') {
    87 			ed.dom.setAttribs(el, args);
    89 			ed.dom.setAttribs(el, args);
    88 		} else {
    90 		} else {
    89 			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />', {skip_undo : 1});
    91 			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
    90 			ed.dom.setAttribs('__mce_tmp', args);
    92 			ed.dom.setAttribs('__mce_tmp', args);
    91 			ed.dom.setAttrib('__mce_tmp', 'id', '');
    93 			ed.dom.setAttrib('__mce_tmp', 'id', '');
    92 			ed.undoManager.add();
    94 			ed.undoManager.add();
    93 		}
    95 		}
    94 
    96