Fix another egregious indeterm bug
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Fri, 29 Jul 2011 15:05:28 -0600
changeset 474 f1f490ebd50f
parent 473 00d77b4fbb8e
child 475 c9ad44506915
Fix another egregious indeterm bug
implementation.js
--- a/implementation.js	Fri Jul 29 14:57:54 2011 -0600
+++ b/implementation.js	Fri Jul 29 15:05:28 2011 -0600
@@ -7552,10 +7552,15 @@
 	// value of the active range's start node."
 	if ("standardInlineValueCommand" in commands[command]) {
 		commands[command].indeterm = function() {
-			return getAllEffectivelyContainedNodes(getActiveRange())
+			var values = getAllEffectivelyContainedNodes(getActiveRange())
 				.filter(function(node) { return isEditable(node) && node.nodeType == Node.TEXT_NODE })
-				.map(function(node) { return getEffectiveCommandValue(node, command) })
-				.length >= 2;
+				.map(function(node) { return getEffectiveCommandValue(node, command) });
+			for (var i = 1; i < values.length; i++) {
+				if (values[i] != values[i - 1]) {
+					return true;
+				}
+			}
+			return false;
 		};
 
 		commands[command].value = function() {