|
40 | 40 | * Post data bridge for IE11 popup
|
41 | 41 | * @type {string}
|
42 | 42 | */
|
43 |
| - this.postDataBridgeUrl = ''; |
| 43 | + this.postBridgeUrl = ''; |
44 | 44 | }
|
45 | 45 |
|
46 | 46 | /**********
|
|
65 | 65 | /**
|
66 | 66 | * Open popup
|
67 | 67 | * Caution:
|
68 |
| - * In IE11, when transfer data to popup by POST, must set the postDataBridgeUrl. |
| 68 | + * In IE11, when transfer data to popup by POST, must set the postBridgeUrl. |
69 | 69 | *
|
70 | 70 | * @param {string} url - popup url
|
71 | 71 | * @param {Object} options
|
|
83 | 83 | * If true, the popup will be reloaded when you try to re-open the popup that has been opened.<br>
|
84 | 84 | * When transmit the POST-data, some browsers alert a message for confirming whether retransmit or not.
|
85 | 85 | *
|
86 |
| - * @param {string} [options.postDataBridgeUrl=''] - Use this url to avoid a certain bug occuring when transmitting POST data to the popup in IE11.<br> |
| 86 | + * @param {string} [options.postBridgeUrl=''] - Use this url to avoid a certain bug occuring when transmitting POST data to the popup in IE11.<br> |
87 | 87 | * This specific buggy situation is known to happen because IE11 tries to open the requested url not in a new popup window as intended, but in a new tab.<br>
|
88 | 88 | * See {@link http://wiki.nhnent.com/pages/viewpage.action?pageId=240562844}
|
89 | 89 | *
|
|
103 | 103 |
|
104 | 104 | options.method = options.method.toUpperCase();
|
105 | 105 |
|
106 |
| - this.postDataBridgeUrl = options.postDataBridgeUrl || this.postDataBridgeUrl; |
| 106 | + this.postBridgeUrl = options.postBridgeUrl || this.postBridgeUrl; |
107 | 107 |
|
108 | 108 | var popup,
|
109 | 109 | formElement,
|
110 | 110 | useIEPostBridge = options.method === 'POST' && options.param &&
|
111 | 111 | tui.util.browser.msie && tui.util.browser.version === 11;
|
112 | 112 |
|
113 | 113 | if (!tui.util.isExisty(url)) {
|
114 |
| - throw new Error('Popup#open() 팝업 URL이 입력되지 않았습니다'); |
| 114 | + throw new Error('Popup#open() need popup url.'); |
115 | 115 | }
|
116 | 116 |
|
117 | 117 | popup_id += 1;
|
|
155 | 155 | this.closeWithParentPopup[options.popupName] = options.closeWithParent;
|
156 | 156 |
|
157 | 157 | if (!popup || popup.closed || tui.util.isUndefined(popup.closed)) {
|
158 |
| - alert('브라우저에 팝업을 막는 기능이 활성화 상태이기 때문에 서비스 이용에 문제가 있을 수 있습니다. 해당 기능을 비활성화 해 주세요'); |
| 158 | + alert('please enable popup windows for this website'); |
159 | 159 | }
|
160 | 160 |
|
161 | 161 | if (options.param && options.method === 'POST' && !useIEPostBridge) {
|
|
298 | 298 | var popup;
|
299 | 299 |
|
300 | 300 | if (useIEPostBridge) {
|
301 |
| - url = this.postDataBridgeUrl + '?storageKey=' + encodeURIComponent(popupName) + |
302 |
| - '&redirectUrl=' + encodeURIComponent(url); |
303 |
| - if (!window.localStorage) { |
304 |
| - alert('IE11브라우저의 문제로 인해 이 기능은 브라우저의 LocalStorage 기능을 활성화 하셔야 이용하실 수 있습니다'); |
305 |
| - } else { |
306 |
| - localStorage.removeItem(popupName); |
307 |
| - localStorage.setItem(popupName, JSON.stringify(param)); |
308 |
| - |
309 |
| - popup = window.open(url, popupName, optionStr); |
310 |
| - } |
| 301 | + popup = window.open(this.postBridgeUrl, popupName, optionStr); |
| 302 | + setTimeout(function() { |
| 303 | + popup.redirect(url, param); |
| 304 | + }, 100); |
311 | 305 | } else {
|
312 | 306 | popup = window.open(url, popupName, optionStr);
|
313 | 307 | }
|
|
316 | 310 | };
|
317 | 311 |
|
318 | 312 | tui.util.popup = new Popup();
|
319 |
| - |
320 | 313 | })(window.tui);
|
0 commit comments