diff options
Diffstat (limited to 'recipes/basecamp')
-rw-r--r-- | recipes/basecamp/package.json | 2 | ||||
-rw-r--r-- | recipes/basecamp/webview.js | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/recipes/basecamp/package.json b/recipes/basecamp/package.json index 391d338..80a33e1 100644 --- a/recipes/basecamp/package.json +++ b/recipes/basecamp/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "basecamp", | 2 | "id": "basecamp", |
3 | "name": "Basecamp", | 3 | "name": "Basecamp", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://launchpad.37signals.com/" | 7 | "serviceURL": "https://launchpad.37signals.com/" |
diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js index 7d13751..2fe8f7b 100644 --- a/recipes/basecamp/webview.js +++ b/recipes/basecamp/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | function show(element) { | 7 | function show(element) { |
8 | element.style.display = 'inherit'; | 8 | element.style.display = 'inherit'; |
9 | } | 9 | } |
@@ -16,16 +16,16 @@ module.exports = Ferdium => { | |||
16 | const modal = document.createElement('div'); | 16 | const modal = document.createElement('div'); |
17 | 17 | ||
18 | const waitFor = (condition, callback) => { | 18 | const waitFor = (condition, callback) => { |
19 | if (!condition()) { | 19 | if (condition()) { |
20 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
21 | } else { | ||
22 | callback(); | 20 | callback(); |
21 | } else { | ||
22 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
23 | } | 23 | } |
24 | }; | 24 | }; |
25 | function showModal(text) { | 25 | function showModal(text) { |
26 | show(modal); | 26 | show(modal); |
27 | 27 | ||
28 | let p = modal.querySelector('p'); | 28 | const p = modal.querySelector('p'); |
29 | 29 | ||
30 | if (p) { | 30 | if (p) { |
31 | p.textContent = text; | 31 | p.textContent = text; |
@@ -34,7 +34,7 @@ module.exports = Ferdium => { | |||
34 | 34 | ||
35 | function hideModal() { | 35 | function hideModal() { |
36 | hide(modal); | 36 | hide(modal); |
37 | let p = modal.querySelector('p'); | 37 | const p = modal.querySelector('p'); |
38 | 38 | ||
39 | if (p) { | 39 | if (p) { |
40 | p.textContent = ''; | 40 | p.textContent = ''; |
@@ -52,7 +52,7 @@ module.exports = Ferdium => { | |||
52 | modal.textContent = | 52 | modal.textContent = |
53 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; | 53 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; |
54 | 54 | ||
55 | let close = modal.querySelector('.close'); | 55 | const close = modal.querySelector('.close'); |
56 | if (close) { | 56 | if (close) { |
57 | close.addEventListener('click', hideModal); | 57 | close.addEventListener('click', hideModal); |
58 | } | 58 | } |