Skip to content

Fix Dialogs on Mobile Devices #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
<button onClick="toggleTrashed()">Trash/Untrash</button>
<button onClick="reply()">Reply</button>
<button onClick="alertDialog()">Pop alert dialog</button>
<button onclick="reportDialog()">Report alert dialog</button>
<button onClick="confirmDialog()">Pop confirm dialog</button>
<button onClick="promptDialog()">Pop prompt dialog</button>
<button onClick="copyText()">Copy Text</button>
<button onclick="fetchTeammates()">Fetch teammates</button>
<button onclick="fetchInboxes()">Fetch inboxes</button>
</body>
Expand Down
19 changes: 16 additions & 3 deletions test-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,25 @@ function reply() {
}

function alertDialog() {
Front.dialog('alert', {
Front.alert({
title: 'I\'m an alert dialog',
message: 'You are now alerted',
}, function () {
console.log('Alert closed');
});
}

function reportDialog() {
Front.report({
title: 'I\'m a report dialog',
message: 'You have been reported'
}, function() {
console.log('Report closed');
});
}

function confirmDialog() {
Front.dialog('confirm', {
Front.confirm({
title: 'I\'m a confirm dialog',
message: 'Do you confirm',
okTitle: 'OK Button',
Expand All @@ -43,7 +52,7 @@ function confirmDialog() {
}

function promptDialog() {
Front.dialog('prompt', {
Front.prompt({
title: 'I\'m a prompt dialog',
message: 'Please enter something'
}, function (data) {
Expand All @@ -54,6 +63,10 @@ function promptDialog() {
});
}

function copyText() {
Front.copyToClipboard('Front is awesome!');
}

function fetchTeammates() {
Front.fetchAllowedTeammates(function (teammates) {
if (!teammates)
Expand Down