Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ Object.defineProperty(app, 'user', {
}
});

Object.defineProperty(app, 'state', {
get: function() {
return state;
}
});

app.init();

// expose app globally for debugging purposes
Expand Down
9 changes: 6 additions & 3 deletions src/app/metrics/intercom.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var _ = require('lodash');
var ipc = require('hadron-ipc');
var app = require('ampersand-app');
var metrics = require('mongodb-js-metrics')();
Expand Down Expand Up @@ -31,9 +32,11 @@ module.exports.configure = function() {
*/
var listenForLinks = getNodeObserver(function(element) {
if (element.nodeName === 'A') {
element.click(app.onLinkClick.bind(app));
} else {
element.querySelectorAll('a').click(app.onLinkClick.bind(app));
element.onclick = app.state.onLinkClick.bind(app.state);
} else if (element.querySelectorAll) {
_.each(element.querySelectorAll('a'), function(node) {
node.onclick = app.state.onLinkClick.bind(app.state);
});
}
});

Expand Down