includes/clientside/tinymce/plugins/advlink/js/advlink.js
changeset 476 f26a69c40431
parent 459 31c23016ab62
child 543 dffcbfbc4e59
--- a/includes/clientside/tinymce/plugins/advlink/js/advlink.js	Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/advlink/js/advlink.js	Thu Mar 06 20:47:11 2008 -0500
@@ -344,6 +344,7 @@
 function setAttrib(elm, attrib, value) {
 	var formObj = document.forms[0];
 	var valueElm = formObj.elements[attrib.toLowerCase()];
+	var dom = tinyMCEPopup.editor.dom;
 
 	if (typeof(value) == "undefined" || value == null) {
 		value = "";
@@ -352,21 +353,11 @@
 			value = valueElm.value;
 	}
 
-	if (value != "") {
-		elm.setAttribute(attrib.toLowerCase(), value);
-
-		if (attrib == "style")
-			attrib = "style.cssText";
+	// Clean up the style
+	if (attrib == 'style')
+		value = dom.serializeStyle(dom.parseStyle(value));
 
-//		if (attrib.substring(0, 2) == 'on')
-//			value = 'return true;' + value;
-
-		if (attrib == "class")
-			attrib = "className";
-
-		elm[attrib] = value;
-	} else
-		elm.removeAttribute(attrib);
+	dom.setAttrib(elm, attrib, value);
 }
 
 function getAnchorListHTML(id, target) {