diff mbox

[30/51] js: Extract a function that changes the current context

Message ID 1441986924-26689-31-git-send-email-damien.lespiau@intel.com
State Superseded
Headers show

Commit Message

Damien Lespiau Sept. 11, 2015, 3:55 p.m. UTC
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@intel.com>
---
 htdocs/js/patchwork.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

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: {