[PATCH 30/51] js: Extract a function that changes the current context
Damien Lespiau
damien.lespiau at intel.com
Sat Sep 12 01:55:03 AEST 2015
Because I'd like to modify the context after init time, let's split out
a function that updates the context (the object that holds global
information, like which project, series, patch we're talking about).
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
htdocs/js/patchwork.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/htdocs/js/patchwork.js b/htdocs/js/patchwork.js
index b92b319..b7c4ad3 100644
--- a/htdocs/js/patchwork.js
+++ b/htdocs/js/patchwork.js
@@ -30,10 +30,14 @@ var pw = (function() {
return reviewer;
}
+ exports.amend_context = function(new_ctx) {
+ $.extend(ctx, new_ctx);
+ }
+
exports.init = function(init_ctx) {
_this = this;
- $.extend(ctx, init_ctx);
+ this.amend_context(init_ctx);
$.dynatableSetup({
dataset: {
--
2.1.0
More information about the Patchwork
mailing list