aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display-context.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-25 09:58:06 -0400
committerGitHub <noreply@github.com>2020-07-25 09:58:06 -0400
commit4a43b41f79d46b8a677bbfb11c27d43e126e670f (patch)
tree93730428d5caaf8076f796349b9bf38e11ef8bfe /ext/mixed/js/display-context.js
parent64ddb4d9011c3577bf70d746bc91787983ec12b5 (diff)
Set content refactor (#686)
* Simplify invoke * Pass isTerms instead of type * Update DisplaySearch.setContent to pass argument array * Simplify argument object structure for setContent * Move focus and disableHistory level * Always include focus and disableHistory options * Change disableHistory to history * Pass source text to setContent * Use consistent argument/object field order * Remove unused previous field * Combine logic for forward/back navigation
Diffstat (limited to 'ext/mixed/js/display-context.js')
-rw-r--r--ext/mixed/js/display-context.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/mixed/js/display-context.js b/ext/mixed/js/display-context.js
index 5ee78459..2322974a 100644
--- a/ext/mixed/js/display-context.js
+++ b/ext/mixed/js/display-context.js
@@ -17,8 +17,9 @@
class DisplayContext {
- constructor(type, definitions, context) {
+ constructor(type, source, definitions, context) {
this.type = type;
+ this.source = source;
this.definitions = definitions;
this.context = context;
}
@@ -43,8 +44,8 @@ class DisplayContext {
return this.context.next;
}
- static push(self, type, definitions, context) {
- const newContext = new DisplayContext(type, definitions, context);
+ static push(self, type, source, definitions, context) {
+ const newContext = new DisplayContext(type, source, definitions, context);
if (self !== null) {
newContext.update({previous: self});
self.update({next: newContext});