Skip to content

Commit 9bae15f

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1049 from magento-engcom/2.1-develop-prs
Public Pull Requests: #9333 #9332
2 parents 87670a7 + 24c9996 commit 9bae15f

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

lib/web/legacy-build.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/web/mage/adminhtml/browser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ define([
1414
"jquery/jstree/jquery.jstree",
1515
"mage/mage"
1616
], function($, tinyMCEm, prompt, confirm, alert){
17-
17+
1818
MediabrowserUtility = {
1919
windowId: 'modal_dialog_message',
2020
getMaxZIndex: function() {
@@ -31,12 +31,14 @@ define([
3131
},
3232
openDialog: function(url, width, height, title, options) {
3333
var windowId = this.windowId,
34-
content = '<div class="popup-window magento-message" "id="' + windowId + '"></div>',
34+
content = '<div class="popup-window magento-message" id="' + windowId + '"></div>',
3535
self = this;
3636

3737
if (this.modal) {
3838
this.modal.html($(content).html());
39-
this.modal.modal('option', 'closed', options.closed);
39+
if (options && typeof options.closed !== 'undefined') {
40+
this.modal.modal('option', 'closed', options.closed);
41+
}
4042
} else {
4143
this.modal = $(content).modal($.extend({
4244
title: title || 'Insert File...',

lib/web/mage/adminhtml/tools.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,12 @@ var Base64 = {
332332
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
333333
var i = 0;
334334

335+
input = Base64._utf8_encode(input);
336+
335337
if( typeof window.btoa === "function" ){
336338
return window.btoa(input);
337339
}
338340

339-
input = Base64._utf8_encode(input);
340-
341341
while (i < input.length) {
342342

343343
chr1 = input.charCodeAt(i++);
@@ -370,7 +370,7 @@ var Base64 = {
370370
var i = 0;
371371

372372
if( typeof window.atob === "function" ){
373-
return window.atob(input);
373+
return Base64._utf8_decode(window.atob(input));
374374
}
375375

376376
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
@@ -395,8 +395,8 @@ var Base64 = {
395395
output = output + String.fromCharCode(chr3);
396396
}
397397
}
398-
output = Base64._utf8_decode(output);
399-
return output;
398+
399+
return Base64._utf8_decode(output);
400400
},
401401

402402
mageEncode: function(input){

0 commit comments

Comments
 (0)