Skip to content

Commit

Permalink
Merge pull request #686 from cmv/modular-config
Browse files Browse the repository at this point in the history
make default config path configureable
  • Loading branch information
tmcgee authored Mar 3, 2017
2 parents edfe9bf + 025ae8e commit 1408666
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion viewer/js/viewer/_ConfigMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) {
Expand Down
9 changes: 9 additions & 0 deletions viewer/js/viewer/_ControllerBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1408666

Please sign in to comment.