|
67 | 67 |
|
68 | 68 | var injector = {
|
69 | 69 | state : {
|
| 70 | + root: null, |
70 | 71 | win: null,
|
71 | 72 | winPosition: {
|
72 | 73 | top: 0,
|
|
141 | 142 | styleElm.innerHTML = injectorStyles;
|
142 | 143 | document.getElementsByTagName('head')[0].appendChild(styleElm);
|
143 | 144 |
|
| 145 | + var rootElm = document.createElement('div'); |
| 146 | + rootElm.setAttribute("id", sp("%prefix%-service-injector")); |
| 147 | + document.body.appendChild(rootElm); |
| 148 | + injector.state.root = rootElm; |
| 149 | + |
144 | 150 | var shadowElm = document.createElement('div');
|
145 | 151 | shadowElm.setAttribute("id", sp("%prefix%-shadow"));
|
146 | 152 | shadowElm.style.position = 'fixed';
|
147 | 153 | shadowElm.style.display = 'none';
|
148 | 154 | shadowElm.style['z-index'] = 99997;
|
149 |
| - document.body.appendChild(shadowElm); |
| 155 | + rootElm.appendChild(shadowElm); |
150 | 156 | injector.state.shadow = shadowElm;
|
151 | 157 |
|
152 | 158 | var tabElm = document.createElement('div');
|
|
156 | 162 | tabElm.style[conf.p] = '0px';
|
157 | 163 | tabElm.style[offsetOrientation[conf.p]] = conf.o;
|
158 | 164 | tabElm.style['z-index'] = 99998;
|
159 |
| - document.body.appendChild(tabElm); |
| 165 | + rootElm.appendChild(tabElm); |
160 | 166 | injector.state.tab = tabElm;
|
161 | 167 |
|
162 | 168 | var winElm = document.createElement('div');
|
|
173 | 179 | if(conf.wl) winElm.style.left = conf.wl;
|
174 | 180 | if(conf.wr) winElm.style.right = conf.wr;
|
175 | 181 | winElm.style['z-index'] = 99999;
|
176 |
| - document.body.appendChild(winElm); |
| 182 | + rootElm.appendChild(winElm); |
177 | 183 | injector.state.win = winElm;
|
178 | 184 | if( typeof conf.wc != 'undefined') {
|
179 | 185 | winElm.style.left = ((screen.width - winElm.offsetWidth+conf.wc) / 2)+"px";
|
|
0 commit comments