summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2019-05-22 01:01:36 -0400
committerYury German <blueknight@gentoo.org>2019-05-22 01:01:36 -0400
commit0914c92da22824025992c368c745546e41fbeb84 (patch)
tree965f6adf3b725e56d559fe4a93eff02281499dcc /plugins/jetpack/extensions/blocks/map/view.js
parentDeleting plugins for update (diff)
downloadblogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.tar.gz
blogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.tar.bz2
blogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.zip
Adding Plugins
Updating the following akismet.4.1.2, google-authenticator.0.52, jetpack.7.3.1 Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/extensions/blocks/map/view.js')
-rw-r--r--plugins/jetpack/extensions/blocks/map/view.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/jetpack/extensions/blocks/map/view.js b/plugins/jetpack/extensions/blocks/map/view.js
new file mode 100644
index 00000000..fc825d67
--- /dev/null
+++ b/plugins/jetpack/extensions/blocks/map/view.js
@@ -0,0 +1,33 @@
+/**
+ * Internal dependencies
+ */
+import './style.scss';
+import component from './component.js';
+import { settings } from './settings.js';
+import FrontendManagement from '../../shared/frontend-management.js';
+
+typeof window !== 'undefined' &&
+ window.addEventListener( 'load', function() {
+ const frontendManagement = new FrontendManagement();
+ // Add apiKey to attibutes so FrontendManagement knows about it.
+ // It is dynamically being added on the php side.
+ // So that it can be updated accross all the map blocks at the same time.
+ const apiKey = {
+ type: 'string',
+ default: '',
+ };
+ frontendManagement.blockIterator( document, [
+ {
+ component: component,
+ options: {
+ settings: {
+ ...settings,
+ attributes: {
+ ...settings.attributes,
+ apiKey,
+ },
+ },
+ },
+ },
+ ] );
+ } );