aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Jones <bjones@galois.com>2012-10-25 17:37:33 -0700
committerGravatar Benjamin Jones <bjones@galois.com>2012-10-25 17:37:33 -0700
commitb2504562731462676f8c6bce561a115742bf470b (patch)
treecbf053108aa3b9aaa32b8f05ad6523e08072e283
parent49ed8f6aed844542f885dfa3bf6a96bb0ba765fd (diff)
changed API of fiveui.font.validate so the allow object has arrays as leaves
-rw-r--r--contexts/data/fiveui/injected/prelude.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/contexts/data/fiveui/injected/prelude.js b/contexts/data/fiveui/injected/prelude.js
index 576ccc8..eb9b0dd 100644
--- a/contexts/data/fiveui/injected/prelude.js
+++ b/contexts/data/fiveui/injected/prelude.js
@@ -308,7 +308,7 @@ fiveui.font.getFont = function (jElt) {
* <p><pre>
* EXAMPLES::
*
- * > allow = { 'Verdana': { 'bold': {"10":{}, "12":{}}, 'normal': {"10":{}, "12":{}} } };
+ * > allow = { 'Verdana': { 'bold': [10, 12], 'normal': [10, 12]}};
* > font = { family: 'Verdana Arial sans-serif', size: "10", weight: "normal" };
* > fiveui.font.validate(allow, font) -> true
* </pre></p>
@@ -323,7 +323,7 @@ fiveui.font.validate = function (allow, font) {
if (font.family.indexOf(x) != -1) { break; }
else { return false; }
}
- return (font.weight in allow[x] && font.size in allow[x][font.weight]);
+ return (font.weight in allow[x] && allow[x][font.weight].indexOf(parseInt(font.size)) != -1);
};
/**