summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-17 21:23:21 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-18 19:14:04 -0400
commit352d214203fba929594c6139189fa59c6772c69f (patch)
treeda0e2be5103cdca6b1c4fb80b2e6eb34d821895d
parentdcfe722ba626a439db621385005aaa57b61835ca (diff)
Isolate objects to background window
-rw-r--r--ext/bg/js/conditions-ui.js15
-rw-r--r--ext/bg/js/settings-profiles.js1
2 files changed, 13 insertions, 3 deletions
diff --git a/ext/bg/js/conditions-ui.js b/ext/bg/js/conditions-ui.js
index 9b161c95..a6f54a1c 100644
--- a/ext/bg/js/conditions-ui.js
+++ b/ext/bg/js/conditions-ui.js
@@ -56,6 +56,11 @@ ConditionsUI.Container = class Container {
// Override
}
+ isolate(object) {
+ // Override
+ return object;
+ }
+
remove(child) {
const index = this.children.indexOf(child);
if (index < 0) {
@@ -68,9 +73,9 @@ ConditionsUI.Container = class Container {
}
onAddConditionGroup() {
- const conditionGroup = {
+ const conditionGroup = this.isolate({
conditions: [this.createDefaultCondition(this.conditionNameDefault)]
- };
+ });
this.conditionGroups.push(conditionGroup);
this.save();
this.children.push(new ConditionsUI.ConditionGroup(this, conditionGroup));
@@ -139,6 +144,10 @@ ConditionsUI.ConditionGroup = class ConditionGroup {
this.parent.save();
}
+ isolate(object) {
+ return this.parent.isolate(object);
+ }
+
remove(child) {
const index = this.children.indexOf(child);
if (index < 0) {
@@ -155,7 +164,7 @@ ConditionsUI.ConditionGroup = class ConditionGroup {
}
onAddCondition() {
- const condition = this.parent.createDefaultCondition(this.parent.conditionNameDefault);
+ const condition = this.isolate(this.parent.createDefaultCondition(this.parent.conditionNameDefault));
this.conditionGroup.conditions.push(condition);
this.children.push(new ConditionsUI.Condition(this, condition));
}
diff --git a/ext/bg/js/settings-profiles.js b/ext/bg/js/settings-profiles.js
index 8796770d..ededc998 100644
--- a/ext/bg/js/settings-profiles.js
+++ b/ext/bg/js/settings-profiles.js
@@ -98,6 +98,7 @@ async function profileFormWrite(optionsFull) {
apiOptionsSave();
conditionsClearCaches(profileConditionsDescriptor);
};
+ profileConditionsContainer.isolate = utilBackgroundIsolate;
}
function profileOptionsPopulateSelect(select, profiles, currentValue, ignoreIndices) {