Skip to content

Commit

Permalink
use context plugin for app version
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Oct 7, 2019
1 parent 34cae67 commit d0792a6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
5 changes: 2 additions & 3 deletions app/js/project_name/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ function(config, templates, version, module) {

var overrides = module.config();

config.version = version;

config.router = {
'base_url': ''
};

config.template = {
'templates': templates,
'defaults': {
'version': version
}
};

config.store = {
Expand Down
7 changes: 7 additions & 0 deletions app/js/project_name/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ function(app, map, patterns, photos, config) {
app.use(map);
app.use(patterns);
app.use(photos);
app.use({
'context': function() {
return {
'version': config.version
};
}
});

var ready = app.init(config).then(function() {
app.jqmInit();
Expand Down
9 changes: 3 additions & 6 deletions app/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ import version from './data/version';

var overrides = window.cordova ? (window.WQ_CONFIG || {}) : {};

config.version = version;

config.router = {
'base_url': ''
};

config.template = {
'templates': templates,
'defaults': {
'version': version
}
};
config.template = { templates };

config.store = {
'service': config.router.base_url,
Expand Down
7 changes: 7 additions & 0 deletions app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import * as serviceWorker from './serviceWorker';
app.use(map);
app.use(patterns);
app.use(photos);
app.use({
context() {
const { version } = config;
return { version };
}
});

var ready = app.init(config).then(function() {
app.jqmInit();
app.prefetchAll();
Expand Down

0 comments on commit d0792a6

Please sign in to comment.