diff src/icons/monocons.js @ 13:8d32537e0ca7

icons again
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 07 Aug 2022 14:28:14 -0600
parents 73d62b7a0713
children
line wrap: on
line diff
--- a/src/icons/monocons.js	Sun Aug 07 13:58:27 2022 -0600
+++ b/src/icons/monocons.js	Sun Aug 07 14:28:14 2022 -0600
@@ -61,52 +61,49 @@
 		'youtube': '<path d="M2 2C1 2 0 3 0 4v8c0 1 1 2 2 2h12c1 0 2-1 2-2V4c0-1-1-2-2-2H2zm4 3l6 3-6 3V5z"/>'
 	};
 
-	sceditor.icons.fn = function () {
-		var nodes = {};
-		var colorPath;
+	var nodes = {};
+	var colorPath;
+
+	sceditor.icons = {
+		create: function (command) {
+			if (command in icons) {
+				nodes[command] = sceditor.dom.parseHTML(
+					'<svg xmlns="http://www.w3.org/2000/svg" ' +
+						'viewbox="0 0 16 16" unselectable="on">' +
+							icons[command] +
+					'</svg>'
+				).firstChild;
 
-		return {
-			create: function (command) {
-				if (command in icons) {
-					nodes[command] = sceditor.dom.parseHTML(
-						'<svg xmlns="http://www.w3.org/2000/svg" ' +
-							'viewbox="0 0 16 16" unselectable="on">' +
-								icons[command] +
-						'</svg>'
-					).firstChild;
+				if (command === 'color') {
+					colorPath = nodes[command].querySelector('.sce-color');
+				}
+			}
 
-					if (command === 'color') {
-						colorPath = nodes[command].querySelector('.sce-color');
-					}
+			return nodes[command];
+		},
+		update: function (isSourceMode, currentNode) {
+			if (colorPath) {
+				var color = 'inherit';
+
+				if (!isSourceMode && currentNode) {
+					color = currentNode.ownerDocument
+						.queryCommandValue('forecolor');
 				}
 
-				return nodes[command];
-			},
-			update: function (isSourceMode, currentNode) {
-				if (colorPath) {
-					var color = 'inherit';
+				dom.css(colorPath, 'fill', color);
+			}
+		},
+		rtl: function (isRtl) {
+			var gripNode = nodes.grip;
 
-					if (!isSourceMode && currentNode) {
-						color = currentNode.ownerDocument
-							.queryCommandValue('forecolor');
-					}
+			if (gripNode) {
+				var transform = isRtl ? 'scaleX(-1)' : '';
 
-					dom.css(colorPath, 'fill', color);
-				}
-			},
-			rtl: function (isRtl) {
-				var gripNode = nodes.grip;
-
-				if (gripNode) {
-					var transform = isRtl ? 'scaleX(-1)' : '';
-
-					dom.css(gripNode, 'transform', transform);
-					dom.css(gripNode, 'msTransform', transform);
-					dom.css(gripNode, 'webkitTransform', transform);
-				}
+				dom.css(gripNode, 'transform', transform);
+				dom.css(gripNode, 'msTransform', transform);
+				dom.css(gripNode, 'webkitTransform', transform);
 			}
-		};
+		},
+		icons: icons
 	};
-
-	sceditor.icons.icons = icons;
 })(document, sceditor);