Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Fix space-separated event subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
vincemtnz committed Jun 21, 2018
1 parent 52e7566 commit 9e516b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/javascript/campaigner_facing/layout_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const LayoutPicker = Backbone.View.extend({
},
});

ee.on('layout:edit pages:new', function() {
ee.on('pages:new', () => {
setupOnce('.layout-settings', LayoutPicker);
});
ee.on('layout:edit', () => {
setupOnce('.layout-settings', LayoutPicker);
});
9 changes: 7 additions & 2 deletions app/javascript/campaigner_facing/tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
import $ from 'jquery';
import ee from '../shared/pub_sub';

ee.on('pages:new pages:edit form:edit pages:analytics', function() {
const initializeTooltips = () => {
// $FlowIgnore
$('[data-toggle="tooltip"]').tooltip();
});
};

ee.on('pages:new', initializeTooltips);
ee.on('pages:edit', initializeTooltips);
ee.on('form:edit', initializeTooltips);
ee.on('pages:analytics', initializeTooltips);

0 comments on commit 9e516b3

Please sign in to comment.