We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 1 |
Paths | 1 |
Total Lines | 48 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | 'use strict'; |
||
25 | confirm: function(message, callback) { |
||
26 | let m = Modal.extend({ |
||
27 | 'template': message, |
||
28 | 'modal': { |
||
29 | 'buttons': { |
||
30 | 'Cancel': { |
||
31 | 'close': true, |
||
32 | 'class': 'warning', |
||
33 | 'flat': true |
||
34 | }, |
||
35 | 'OK': { |
||
36 | 'class': 'success', |
||
37 | 'flat': true, |
||
38 | 'save': true |
||
39 | } |
||
40 | }, |
||
41 | 'events': { |
||
42 | 'modal:save': 'confirm' |
||
43 | } |
||
44 | }, |
||
45 | confirm: function() { |
||
46 | this.showLoader(); |
||
47 | |||
48 | let close = _.bind(function() { |
||
49 | this.$el.modal('hide'); |
||
50 | this.hideLoader(); |
||
51 | }, this); |
||
52 | |||
53 | if (_.isFunction(callback)) { |
||
54 | let response = callback.call(this, true); |
||
55 | |||
56 | if (response instanceof Promise || response instanceof $.Deferred || _.result(response, 'then')) { |
||
57 | response.then(close); |
||
58 | } else { |
||
59 | close.apply(this) |
||
60 | } |
||
61 | } else { |
||
62 | close.apply(this); |
||
63 | } |
||
64 | } |
||
65 | }); |
||
66 | |||
67 | let v = new m(); |
||
68 | |||
69 | v.render(); |
||
70 | |||
71 | return v; |
||
72 | } |
||
73 | }; |
||
74 | }); |