Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Remove items from app.js #1576

Benjamin King0049b46a7876
diff --git a/web/js/app.js b/web/js/app.js
index f1dc8dbd6..f362b6a0b 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -10,18 +10,9 @@ import OlCoordinates from './components/map/ol-coordinates';
import Toolbar from './containers/toolbar';
// Modal
import Modal from './containers/modal';
-// Notifications
-import {
- STATUS_REQUEST_URL,
- REQUEST_NOTIFICATIONS
-} from './modules/notifications/constants';
-import {
- requestNotifications,
- setNotifications
-} from './modules/notifications/actions';
+
// Other
import Brand from './brand';
-import { debugConfig } from './debug';
// Crutch between state systems
import { updateLegacyInitComplete } from './modules/migration/actions';
@@ -201,22 +192,21 @@ class App extends React.Component {
config = self.props.config;
config.parameters = state;
- debugConfig(config);
- // Load any additional scripts as needed
- if (config.scripts) {
- lodashEach(config.scripts, function(script) {
- $.getScript(script);
- });
- }
+
const main = function() {
const models = self.props.models;
+ // Load any additional scripts as needed
+ if (config.scripts) {
+ lodashEach(config.scripts, function(script) {
+ $.getScript(script);
+ });
+ }
if (config.features.googleTagManager) {
googleTagManager.init(config.features.googleTagManager.id); // Insert google tag manager
}
document.activeElement.blur();
$('input').blur();
- $('#eventsHolder').hide();
// Console notifications
if (Brand.release()) {
@@ -232,20 +222,7 @@ class App extends React.Component {
}
models.wv.events.trigger('startup');
-
- // Reset Worldview when clicking on logo
- $(document).click(function(e) {
- if (e.target.id === 'wv-logo') resetWorldview(e);
- });
- self.props.updateLegacyInitComplete();
- };
-
- var resetWorldview = function(e) {
- e.preventDefault();
- if (window.location.search === '') return; // Nothing to reset
- var msg =
- 'Do you want to reset Worldview to its defaults? You will lose your current state.';
- if (confirm(msg)) document.location.href = '/';
+ self.props.updateLegacyInitComplete(); // notify state that legacy initiation has finished
};
util.wrap(main)();
}
@@ -263,17 +240,6 @@ function mapStateToProps(state, ownProps) {
const mapDispatchToProps = dispatch => ({
updateLegacyInitComplete: () => {
dispatch(updateLegacyInitComplete());
- },
- requestNotifications: location => {
- const promise = dispatch(
- requestNotifications(location, REQUEST_NOTIFICATIONS, 'json')
- );
- promise.then(data => {
- const obj = JSON.parse(data);
- if (obj.notifications) {
- dispatch(setNotifications(obj.notifications));
- }
- });
}
});
diff --git a/web/js/combine-ui.js b/web/js/combine-ui.js
index 70719bc9e..f21ff2cba 100644
--- a/web/js/combine-ui.js
+++ b/web/js/combine-ui.js
@@ -135,6 +135,13 @@ export function combineUi(models, config, MapMouseEvents) {
}
});
debugLayers(ui, models, config);
+ // Reset Worldview when clicking on logo
+ $(document).click(function(e) {
+ if (e.target.id === 'wv-logo') resetWorldview(e);
+ });
+ document.activeElement.blur();
+ $('input').blur();
+
return ui;
}
function registerMapMouseHandlers(maps, events) {
@@ -152,3 +159,10 @@ function registerMapMouseHandlers(maps, events) {
});
});
}
+var resetWorldview = function(e) {
+ e.preventDefault();
+ if (window.location.search === '') return; // Nothing to reset
+ var msg =
+ 'Do you want to reset Worldview to its defaults? You will lose your current state.';
+ if (confirm(msg)) document.location.href = '/';
+};
diff --git a/web/js/main.js b/web/js/main.js
index b0b7260c7..2a9571915 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -26,6 +26,7 @@ import palettes from './palettes/palettes';
import { updateLegacyModule } from './modules/migration/actions';
import { validate as layerValidate } from './layers/layers';
import { polyfill } from './polyfill';
+import { debugConfig } from './debug';
const history = createBrowserHistory();
const isDevelop = !!(
@@ -65,6 +66,7 @@ window.onload = () => {
const render = (config, parameters, legacyState) => {
config.parameters = parameters;
+ debugConfig(config);
let models = combineModels(config, legacyState); // Get legacy models
// Get Permalink parse/serializers