/
liquid-tether-dialog.js
40 lines (37 loc) · 1.11 KB
/
liquid-tether-dialog.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { computed } from '@ember/object';
import { dasherize } from '@ember/string';
import BasicDialog from './basic-dialog';
import layout from '../templates/components/liquid-tether-dialog';
export default BasicDialog.extend({
layout,
targetAttachmentClass: computed('targetAttachment', function() {
let targetAttachment = this.get('targetAttachment') || '';
return `ember-modal-dialog-target-attachment-${dasherize(targetAttachment)}`;
}),
targetAttachment: null,
attachment: null,
didReceiveAttrs() {
this._super(...arguments);
if (!this.get('attachment')) {
this.set('attachment', 'middle center');
}
if (!this.get('targetAttachment')) {
this.set('targetAttachment', 'middle center');
}
},
tetherClassPrefix: computed({
get() {
return 'liquid-tether';
}, set(key, val) {
if (val) {
return val;
}
return 'liquid-tether';
}
}),
hasOverlay: true,
tetherTarget: null, // element, css selector, view instance, 'viewport', or 'scroll-handle'
// offset - passed in
// targetOffset - passed in
// targetModifier - passed in
});