File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 44
44
}
45
45
46
46
function updateDirection ( ) {
47
+ getRTL ( ) ;
47
48
DOCUMENT_DIR = document . documentElement . getAttribute ( 'dir' ) ;
48
49
for ( let i = 0 ; i < DIR_INSTANCES . length ; i ++ ) {
49
50
setRTL ( DIR_INSTANCES [ i ] ) ;
50
51
}
51
52
}
52
53
54
+ function takeRecords ( ) {
55
+ if ( observer && observer . takeRecords ( ) . length ) {
56
+ updateDirection ( ) ;
57
+ }
58
+ }
59
+
53
60
/**
54
61
* Element class mixin that allows elements to use the `:dir` CSS Selector to have
55
62
* text direction specific styling.
133
140
this . __autoDirOptOut = /** @type {!HTMLElement } */ ( this ) . hasAttribute ( 'dir' ) ;
134
141
}
135
142
136
- /** @suppress {missingProperties} Closure's understanding of prototypes is bad */
143
+ /** @suppress {missingProperties} If it exists on elementBase, it can be super'd */
137
144
connectedCallback ( ) {
138
145
if ( elementBase . prototype . connectedCallback ) {
139
- /** @type { !Polymer_ElementMixin } */ ( elementBase ) . prototype . connectedCallback . call ( this ) ;
146
+ super . connectedCallback ( ) ;
140
147
}
141
148
if ( this . constructor . __activateDir ) {
149
+ takeRecords ( ) ;
142
150
DIR_INSTANCES . push ( this ) ;
143
- getRTL ( ) ;
144
151
setRTL ( this ) ;
145
152
}
146
153
}
147
154
148
- /** @suppress {missingProperties} Closure's understanding of prototypes is bad */
155
+ /** @suppress {missingProperties} If it exists on elementBase, it can be super'd */
149
156
disconnectedCallback ( ) {
150
157
if ( elementBase . prototype . disconnectedCallback ) {
151
- /** @type { !Polymer_ElementMixin } */ ( elementBase ) . prototype . disconnectedCallback . call ( this ) ;
158
+ super . disconnectedCallback ( ) ;
152
159
}
153
160
if ( this . constructor . __activateDir ) {
154
161
const idx = DIR_INSTANCES . indexOf ( this ) ;
You can’t perform that action at this time.
0 commit comments