|
54 | 54 | * Do NOT remove the original layout Attribute selectors
|
55 | 55 | * after translation injection; or the media breakpoints will not fire
|
56 | 56 | */
|
57 |
| - removeAttributes : true, |
| 57 | + removeAttributes : true |
58 | 58 |
|
59 |
| - /** |
60 |
| - * Special internal flag used to optimize |
61 |
| - * noop(s) for the directive postLinks below |
62 |
| - */ |
63 |
| - enablePostLinks : undefined |
64 | 59 | };
|
65 | 60 | })
|
66 | 61 |
|
|
173 | 168 | return {
|
174 | 169 | restrict : 'A',
|
175 | 170 | compile: function(element, attr) {
|
176 |
| - var injected = injectLayoutSpecifier(element, attr); |
177 |
| - var enabled = isPostLinkEnabled($document[0]); |
178 |
| - |
179 | 171 | // Use for postLink to account for transforms after ng-transclude.
|
180 |
| - if ( !injected && enabled ) { |
| 172 | + |
| 173 | + if ( !injectLayoutSpecifier(element, attr) ) { |
181 | 174 | attributeValueToClass(null, element, attr);
|
182 | 175 | return attributeValueToClass;
|
183 | 176 | }
|
|
289 | 282 | return {
|
290 | 283 | restrict : 'A',
|
291 | 284 | compile: function(element, attrs) {
|
292 |
| - if ( !isPostLinkEnabled($document[0]) ) return angular.noop; |
293 | 285 |
|
294 | 286 | attributeToClass(null, element);
|
295 | 287 |
|
|
327 | 319 |
|
328 | 320 | }
|
329 | 321 |
|
330 |
| - /** |
331 |
| - * Scan the body element. If it has a class 'md-css-only', then do NOT |
332 |
| - * postLink process the directives for Attribute selectors. |
333 |
| - * (recall that postlink injects Class selectors based on attribute selector settings) |
334 |
| - * |
335 |
| - * Instead the Layout CSS for Attributes is used: |
336 |
| - * e.g |
337 |
| - * .md-css-only [layout=row] { |
338 |
| - * flex-direction: row; |
339 |
| - * -webkit-flex-direction: row; |
340 |
| - * } |
341 |
| - * |
342 |
| - * Note: this means that 'md-css-only' will not work for IE (due to performance issues) |
343 |
| - * In these cases, the Layout translators (directives) should be enabled and the |
344 |
| - * `angular-material.[min.]js` must be loaded. |
345 |
| - */ |
346 |
| - function isPostLinkEnabled(document) { |
347 |
| - var enablePostLinks = $$mdLayout.enablePostLinks; |
348 |
| - |
349 |
| - // Perform a read-once (1x) check for the `md-css-only` class on the BODY |
350 |
| - |
351 |
| - if ( angular.isUndefined(enablePostLinks) ) { |
352 |
| - var body = document && document.body; |
353 |
| - if (body) enablePostLinks = !body.classList.contains('md-css-only'); |
354 |
| - } |
355 |
| - |
356 |
| - return $$mdLayout.enablePostLinks = enablePostLinks; |
357 |
| - } |
358 |
| - |
359 | 322 | })();
|
0 commit comments