From 1ee3e7fc04a7df5820dbcdd61e1bae3dbb378391 Mon Sep 17 00:00:00 2001 From: Gregg Roemhildt Date: Thu, 2 Mar 2017 19:58:19 -0600 Subject: [PATCH 1/2] make default config file configureable --- viewer/js/viewer/_ConfigMixin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/viewer/js/viewer/_ConfigMixin.js b/viewer/js/viewer/_ConfigMixin.js index 10a7929fe..999f8ab14 100644 --- a/viewer/js/viewer/_ConfigMixin.js +++ b/viewer/js/viewer/_ConfigMixin.js @@ -9,6 +9,10 @@ define([ ) { return declare(null, { + + // the default name of the config file to load if ?config=configName + // is not specified + defaultConfig: 'viewer', loadConfig: function (wait) { // this will be used to make any inherited methods 'wait' @@ -49,7 +53,7 @@ define([ initConfigAsync: function () { var returnDeferred = new Deferred(); // get the config file from the url if present - var file = 'config/viewer', + var file = 'config/' + this.defaultConfig, s = window.location.search, q = s.match(/config=([^&]*)/i); if (q && q.length > 0) { From 36a3727e43a9246ae6a7709b033e24a8c68337cb Mon Sep 17 00:00:00 2001 From: roemhildtg Date: Fri, 3 Mar 2017 13:08:41 -0600 Subject: [PATCH 2/2] mix-in parameters passed to app constructor --- viewer/js/viewer/_ControllerBase.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/viewer/js/viewer/_ControllerBase.js b/viewer/js/viewer/_ControllerBase.js index 20958b0d8..4ae03c5f7 100644 --- a/viewer/js/viewer/_ControllerBase.js +++ b/viewer/js/viewer/_ControllerBase.js @@ -8,6 +8,15 @@ define([ ) { return declare(null, { + /** + * Mixes in this apps properties with the passed arguments + * @param {Object} args The properties to mixin + * @return {undefined} + */ + constructor: function (args) { + lang.mixin(this, args); + }, + /** * A method run before anything else, can be inherited by mixins to * load and process the config sync or async