Skip to content

Commit

Permalink
don't assume require() is available
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Sep 2, 2020
1 parent bbf2498 commit b5f5de1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/js/project_name/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ app.use({
return {
'version': config.version
};
},
'run': function($page) {
$page.find('form[data-wq-confirm]').on('submit', function() {
return app.confirmSubmit(this, 'Are you sure you want to delete this record?');
});
$page.find('button[data-wq-action="sync"]').on('click', function() {
app.retryAll();
});
$page.find('button[data-wq-action="empty-outbox"]').on('click', function() {
app.emptyOutbox(true);
});
}
});

Expand Down
11 changes: 11 additions & 0 deletions app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ app.use({
context() {
const { version } = config;
return { version };
},
run($page) {
$page.find('form[data-wq-confirm]').on('submit', () => {
return app.confirmSubmit(this, 'Are you sure you want to delete this record?');
});
$page.find('button[data-wq-action="sync"]').on('click', () => {
app.retryAll();
});
$page.find('button[data-wq-action="empty-outbox"]').on('click', () => {
app.emptyOutbox(true);
});
}
});

Expand Down

0 comments on commit b5f5de1

Please sign in to comment.