aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-10-08 14:07:32 -0400
committerbob <bcz@cs.brown.edu>2019-10-08 14:07:32 -0400
commit84211163c9f085a521b3ca3af0dc9103640e3622 (patch)
treef9b6852e32bb1dbad4686ffc496afea656a366fc /src/Utils.ts
parentde0b723551eb033f7ad1999dd23309b4f306f344 (diff)
cleaned up tagging of text spans with data and timestamps
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index f6ab434a8..489de3b50 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -349,5 +349,16 @@ export function addStyleSheetRule(sheet: any, selector: any, css: any) {
return sheet.insertRule("." + selector + "{" + propText + "}", sheet.cssRules.length);
}
export function removeStyleSheetRule(sheet: any, rule: number) {
- sheet.removeRule(rule);
+ if (sheet.rules.length) {
+ sheet.removeRule(rule);
+ return true;
+ }
+ return false;
+}
+export function clearStyleSheetRules(sheet: any) {
+ if (sheet.rules.length) {
+ numberRange(sheet.rules.length).map(n => sheet.removeRule(0));
+ return true;
+ }
+ return false;
} \ No newline at end of file