|
1 | 1 | (function (window, ufe, undefined) {
|
2 | 2 | 'use strict';
|
3 | 3 |
|
4 |
| - var mfeEventHadler = function (evt) { |
| 4 | + var mfeEventHandler = function (evt) { |
5 | 5 | console.log(evt);
|
6 | 6 | switch (evt.type) {
|
7 | 7 | case 'beforeCreate':
|
|
37 | 37 | }
|
38 | 38 |
|
39 | 39 | var globalHandlers = new ufe.ComponentEventHandlers();
|
40 |
| - globalHandlers['beforeCreate'] = mfeEventHadler; |
41 |
| - globalHandlers['created'] = mfeEventHadler; |
42 |
| - globalHandlers['beforeMount'] = mfeEventHadler; |
43 |
| - globalHandlers['mounted'] = mfeEventHadler; |
44 |
| - globalHandlers['beforeUpdate'] = mfeEventHadler; |
45 |
| - globalHandlers['updated'] = mfeEventHadler; |
46 |
| - globalHandlers['beforeDestroy'] = mfeEventHadler; |
47 |
| - globalHandlers['destroyed'] = mfeEventHadler; |
48 |
| - globalHandlers['error'] = mfeEventHadler; |
49 |
| - globalHandlers['data'] = mfeEventHadler; |
| 40 | + globalHandlers['beforeCreate'] = mfeEventHandler; |
| 41 | + globalHandlers['created'] = mfeEventHandler; |
| 42 | + globalHandlers['beforeMount'] = mfeEventHandler; |
| 43 | + globalHandlers['mounted'] = mfeEventHandler; |
| 44 | + globalHandlers['beforeUpdate'] = mfeEventHandler; |
| 45 | + globalHandlers['updated'] = mfeEventHandler; |
| 46 | + globalHandlers['beforeDestroy'] = mfeEventHandler; |
| 47 | + globalHandlers['destroyed'] = mfeEventHandler; |
| 48 | + globalHandlers['error'] = mfeEventHandler; |
| 49 | + globalHandlers['data'] = mfeEventHandler; |
50 | 50 |
|
51 | 51 |
|
52 | 52 | var configuration = new ufe.RootComponentOptions();
|
|
152 | 152 | mainNavBarCustomEl.resources.push(mainNavBarCustomElScript);
|
153 | 153 |
|
154 | 154 | var mainNavBarIframe = new ufe.CrossWindowChildComponentOptions();
|
155 |
| - mainNavBarIframe.url ='./embeded-nav-bar.html' |
| 155 | + mainNavBarIframe.url ='./embedded-nav-bar.html' |
156 | 156 | mainNavBarIframe.handlers = Object.assign({}, globalHandlers, {
|
157 | 157 | 'created': function (e) {
|
158 | 158 | e.el.parentElement.insertBefore(e.el, e.el.parentElement.firstChild);
|
159 |
| - e.el.parentElement.classList.add('embeded-nav-bar'); |
| 159 | + e.el.parentElement.classList.add('embedded-nav-bar'); |
160 | 160 |
|
161 | 161 | globalHandlers['created'](e);
|
162 | 162 | },
|
|
165 | 165 | globalHandlers['destroyed'](e);
|
166 | 166 | }
|
167 | 167 | });
|
168 |
| - mainNavBarIframe.embededAttributes = { |
| 168 | + mainNavBarIframe.embeddedAttributes = { |
169 | 169 | 'allowtransparency': 'true',
|
170 | 170 | 'frameborder': 0
|
171 | 171 | };
|
|
228 | 228 | }
|
229 | 229 |
|
230 | 230 | function bang() {
|
231 |
| - window.location = ufe.getUrlFullPath(document, './index.html') + '#/'; |
| 231 | + if (window.location.href.indexOf('#') !== -1) { |
| 232 | + return; |
| 233 | + } |
| 234 | + |
| 235 | + var pathname = window.location.pathname; |
| 236 | + if (pathname === '/') { |
| 237 | + pathname = '/index.html'; |
| 238 | + } |
| 239 | + var pathParts = pathname.split('/'); |
| 240 | + |
| 241 | + window.location = ufe.getUrlFullPath(document, './' + pathParts[pathParts.length - 1]) + '#_/'; |
232 | 242 | }
|
233 | 243 |
|
234 | 244 | function initDemoHandlers() {
|
|
0 commit comments