|
8 | 8 |
|
9 | 9 | <div class="example">
|
10 | 10 | <h3>app/transitions.js for these examples</h3>
|
11 |
| - {{code-snippet name="animated-transitions.js"}} |
| 11 | + <CodeSnippet @name="animated-transitions.js" /> |
12 | 12 | </div>
|
13 | 13 |
|
14 | 14 | <div class="example" id="example-basic">
|
15 | 15 | <h2>Basic</h2>
|
16 | 16 | <button {{action "toggleBasic"}}>Do It</button>
|
17 |
| - {{code-snippet name="basic-modal-dialog-animatable.hbs"}} |
| 17 | + <CodeSnippet @name="basic-modal-dialog-animatable.hbs" /> |
18 | 18 | {{#if isShowingBasic}}
|
19 | 19 | {{!-- BEGIN-SNIPPET basic-modal-dialog-animatable --}}
|
20 |
| - {{#modal-dialog |
21 |
| - onClose=(action "toggleBasic") |
22 |
| - overlayPosition="sibling" |
23 |
| - clickOutsideToClose=true |
24 |
| - animatable=true |
25 |
| - }} |
| 20 | + <ModalDialog @onClose={{action "toggleBasic"}} @overlayPosition="sibling" @clickOutsideToClose={{true}} @animatable={{true}}> |
26 | 21 | <h1>Stop! Modal Time!</h1>
|
27 | 22 | <p>Basic</p>
|
28 | 23 | <button {{action "toggleBasic"}}>Close</button>
|
29 |
| - {{/modal-dialog}} |
| 24 | + </ModalDialog> |
30 | 25 | {{!-- END-SNIPPET --}}
|
31 | 26 | {{/if}}
|
32 | 27 | </div>
|
33 | 28 |
|
34 | 29 | <div class="example" id="example-translucent">
|
35 | 30 | <h2>With Translucent Overlay</h2>
|
36 | 31 | <button {{action "toggleTranslucent"}}>Do It</button>
|
37 |
| - {{code-snippet name="translucent-modal-dialog-animatable.hbs"}} |
| 32 | + <CodeSnippet @name="translucent-modal-dialog-animatable.hbs" /> |
38 | 33 | {{#if isShowingTranslucent}}
|
39 | 34 | {{!-- BEGIN-SNIPPET translucent-modal-dialog-animatable --}}
|
40 |
| - {{#modal-dialog |
41 |
| - onClose=(action "toggleTranslucent") |
42 |
| - translucentOverlay=true |
43 |
| - overlayPosition="sibling" |
44 |
| - clickOutsideToClose=true |
45 |
| - animatable=true |
46 |
| - }} |
| 35 | + <ModalDialog @onClose={{action "toggleTranslucent"}} @translucentOverlay={{true}} @overlayPosition="sibling" @clickOutsideToClose={{true}} @animatable={{true}}> |
47 | 36 | <h1>Stop! Modal Time!</h1>
|
48 | 37 | <p>With Translucent Overlay</p>
|
49 | 38 | <button {{action "toggleTranslucent"}}>Close</button>
|
50 |
| - {{/modal-dialog}} |
| 39 | + </ModalDialog> |
51 | 40 | {{!-- END-SNIPPET --}}
|
52 | 41 | {{/if}}
|
53 | 42 | </div>
|
54 | 43 |
|
55 | 44 | <div class="example" id="example-without-overlay">
|
56 | 45 | <h2>Without Overlay</h2>
|
57 | 46 | <button {{action "toggleWithoutOverlay"}}>Do It</button>
|
58 |
| - {{code-snippet name="without-overlay-modal-dialog-animatable.hbs"}} |
| 47 | + <CodeSnippet @name="without-overlay-modal-dialog-animatable.hbs" /> |
59 | 48 | {{#if isShowingWithoutOverlay}}
|
60 | 49 | {{!-- BEGIN-SNIPPET without-overlay-modal-dialog-animatable --}}
|
61 |
| - {{#modal-dialog |
62 |
| - onClose=(action "toggleWithoutOverlay") |
63 |
| - hasOverlay=false |
64 |
| - animatable=true |
65 |
| - }} |
| 50 | + <ModalDialog @onClose={{action "toggleWithoutOverlay"}} @hasOverlay={{false}} @animatable={{true}}> |
66 | 51 | <h1>Stop! Modal Time!</h1>
|
67 | 52 | <p>Without Overlay</p>
|
68 | 53 | <button {{action "toggleWithoutOverlay"}}>Close</button>
|
69 |
| - {{/modal-dialog}} |
| 54 | + </ModalDialog> |
70 | 55 | {{!-- END-SNIPPET --}}
|
71 | 56 | {{/if}}
|
72 | 57 | </div>
|
|
80 | 65 | >
|
81 | 66 | Another one
|
82 | 67 | </button>
|
83 |
| - {{code-snippet |
84 |
| - name="without-overlay-click-outside-to-close-modal-dialog-animatable.hbs" |
85 |
| - }} |
| 68 | + <CodeSnippet @name="without-overlay-click-outside-to-close-modal-dialog-animatable.hbs" /> |
86 | 69 | {{#if isShowingWithoutOverlayClickOutsideToClose}}
|
87 | 70 | {{!-- BEGIN-SNIPPET without-overlay-click-outside-to-close-modal-dialog-animatable --}}
|
88 |
| - {{#modal-dialog |
89 |
| - onClose=(action "toggleWithoutOverlayClickOutsideToClose") |
90 |
| - hasOverlay=false |
91 |
| - clickOutsideToClose=true |
92 |
| - animatable=true |
93 |
| - }} |
| 71 | + <ModalDialog @onClose={{action "toggleWithoutOverlayClickOutsideToClose"}} @hasOverlay={{false}} @clickOutsideToClose={{true}} @animatable={{true}}> |
94 | 72 | <h1>Stop! Modal Time!</h1>
|
95 | 73 | <p>Without Overlay - Click Outside to Close</p>
|
96 | 74 | <button {{action "toggleWithoutOverlayClickOutsideToClose"}}>Close</button>
|
97 |
| - {{/modal-dialog}} |
| 75 | + </ModalDialog> |
98 | 76 | {{!-- END-SNIPPET --}}
|
99 | 77 | {{/if}}
|
100 | 78 | {{#if isShowingWithoutOverlayClickOutsideToCloseAnotherOne}}
|
101 |
| - {{#modal-dialog |
102 |
| - onClose=(action "toggleWithoutOverlayClickOutsideToCloseAnotherOne") |
103 |
| - hasOverlay=false |
104 |
| - clickOutsideToClose=true |
105 |
| - offset="100px 0" |
106 |
| - animatable=true |
107 |
| - }} |
| 79 | + <ModalDialog @onClose={{action "toggleWithoutOverlayClickOutsideToCloseAnotherOne"}} @hasOverlay={{false}} @clickOutsideToClose={{true}} @offset="100px 0" @animatable={{true}}> |
108 | 80 | <h1>Stop! Another modal!</h1>
|
109 | 81 | <p>Without Overlay Another One - Click Outside to Close</p>
|
110 | 82 | <button {{action "toggleWithoutOverlayClickOutsideToCloseAnotherOne"}}>Close</button>
|
111 |
| - {{/modal-dialog}} |
| 83 | + </ModalDialog> |
112 | 84 | {{/if}}
|
113 | 85 |
|
114 | 86 | </div>
|
115 | 87 |
|
116 | 88 | <div class="example" id="example-custom-styles">
|
117 | 89 | <h2>Custom Styles</h2>
|
118 |
| - <button onclick={{action (mut isShowingCustomStyles true)}}>Do It</button> |
119 |
| - {{code-snippet name="custom-styles-modal-dialog-animatable.hbs"}} |
120 |
| - {{code-snippet name="custom-styles.scss"}} |
| 90 | + <button onclick={{action (mut isShowingCustomStyles) true}}>Do It</button> |
| 91 | + <CodeSnippet @name="custom-styles-modal-dialog-animatable.hbs" /> |
| 92 | + <CodeSnippet @name="custom-styles.scss" /> |
121 | 93 | {{#if isShowingCustomStyles}}
|
122 | 94 | {{!-- BEGIN-SNIPPET custom-styles-modal-dialog-animatable --}}
|
123 |
| - {{#modal-dialog |
124 |
| - onClose=(action (mut isShowingCustomStyles false)) |
125 |
| - containerClass="custom-styles-modal-container" |
126 |
| - overlayClass="custom-styles-overlay" |
127 |
| - wrapperClass="custom-styles-wrapper" |
128 |
| - overlayPosition="sibling" |
129 |
| - clickOutsideToClose=true |
130 |
| - targetAttachment="none" |
131 |
| - animatable=true |
132 |
| - }} |
| 95 | + <ModalDialog @onClose={{action (mut isShowingCustomStyles) false}} @containerClass="custom-styles-modal-container" @overlayClass="custom-styles-overlay" @wrapperClass="custom-styles-wrapper" @overlayPosition="sibling" @clickOutsideToClose={{true}} @targetAttachment="none" @animatable={{true}}> |
133 | 96 | <h1>Stop! Modal Time!</h1>
|
134 | 97 | <p>Custom Styles</p>
|
135 |
| - <button {{action (action (mut isShowingCustomStyles false))}}>Close</button> |
136 |
| - {{/modal-dialog}} |
| 98 | + <button {{action (action (mut isShowingCustomStyles) false)}}>Close</button> |
| 99 | + </ModalDialog> |
137 | 100 | {{!-- END-SNIPPET --}}
|
138 | 101 | {{/if}}
|
139 | 102 | </div>
|
140 | 103 |
|
141 | 104 | <div class="example" id="example-subclass">
|
142 | 105 | <h2>Via Subclass</h2>
|
143 | 106 | <button {{action "toggleSubclassed"}}>Do It</button>
|
144 |
| - {{code-snippet name="subclass.js"}} |
145 |
| - {{code-snippet name="subclass-modal-dialog-animatable.hbs"}} |
146 |
| - {{code-snippet name="subclass-styles.scss"}} |
| 107 | + <CodeSnippet @name="subclass.js" /> |
| 108 | + <CodeSnippet @name="subclass-modal-dialog-animatable.hbs" /> |
| 109 | + <CodeSnippet @name="subclass-styles.scss" /> |
147 | 110 | {{#if isShowingSubclassed}}
|
148 | 111 | {{!-- BEGIN-SNIPPET subclass-modal-dialog-animatable --}}
|
149 |
| - {{#my-cool-modal-dialog |
150 |
| - onClose=(action "toggleSubclassed") |
151 |
| - animatable=true |
152 |
| - }} |
| 112 | + <MyCoolModalDialog @onClose={{action "toggleSubclassed"}} @animatable={{true}}> |
153 | 113 | <h1>Stop! Modal Time!</h1>
|
154 | 114 | <p>Via Subclass</p>
|
155 | 115 | <button {{action "toggleSubclassed"}}>Close</button>
|
156 |
| - {{/my-cool-modal-dialog}} |
| 116 | + </MyCoolModalDialog> |
157 | 117 | {{!-- END-SNIPPET --}}
|
158 | 118 | {{/if}}
|
159 | 119 | </div>
|
0 commit comments