Skip to content

Commit

Permalink
removed tinyMceEditors hash from prototypejs
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed May 9, 2023
1 parent 828ef09 commit d43ca5c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var queueControl = {
return false;
},
isEditor: function() {
return (typeof tinyMceEditors != 'undefined' && tinyMceEditors.get(this.id) != undefined)
return (typeof tinyMceEditors != 'undefined' && tinyMceEditors[this.id] != undefined)
},
resume: function() {
$('_resume_flag').value = '1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@
},

isEditor: function() {
return (typeof tinyMceEditors != 'undefined' && tinyMceEditors.get(this.id) != undefined)
return (typeof tinyMceEditors != 'undefined' && tinyMceEditors[this.id] != undefined)
},

getEditor: function() {
return tinyMceEditors.get(this.id);
return tinyMceEditors[this.id];
}
};

Expand Down
6 changes: 3 additions & 3 deletions js/mage/adminhtml/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Mediabrowser.prototype = {
getTargetElement: function() {
if (typeof(tinyMCE) != 'undefined' && tinyMCE.get(this.targetElementId)) {
if ((opener = this.getMediaBrowserOpener())) {
var targetElementId = tinyMceEditors.get(this.targetElementId).getMediaBrowserTargetElementId();
var targetElementId = tinyMceEditors[this.targetElementId].getMediaBrowserTargetElementId();
return opener.document.getElementById(targetElementId);
} else {
return null;
Expand All @@ -233,8 +233,8 @@ Mediabrowser.prototype = {
if (typeof(tinyMCE) != 'undefined'
&& tinyMCE.get(this.targetElementId)
&& typeof(tinyMceEditors) != 'undefined'
&& ! tinyMceEditors.get(this.targetElementId).getMediaBrowserOpener().closed) {
return tinyMceEditors.get(this.targetElementId).getMediaBrowserOpener();
&& ! tinyMceEditors[this.targetElementId].getMediaBrowserOpener().closed) {
return tinyMceEditors[this.targetElementId].getMediaBrowserOpener();
} else {
return null;
}
Expand Down
10 changes: 7 additions & 3 deletions js/mage/adminhtml/wysiwyg/tinymce/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ tinyMceWysiwygSetup.prototype =
this.id = htmlId;
this.selector = 'textarea#' + htmlId;
this.config = config;
this.automatic_uploads = false;
this.file_picker_callback = function(fieldName, url, objectType, w) {
varienGlobalEvents.fireEvent("open_browser_callback", {win:w, type:objectType, field:fieldName});
};
varienGlobalEvents.attachEventHandler('tinymceChange', this.onChangeContent.bind(this));
if(typeof tinyMceEditors == 'undefined') {
tinyMceEditors = $H({});
if (typeof tinyMceEditors == 'undefined') {
tinyMceEditors = [];
}
tinyMceEditors.set(this.id, this);
tinyMceEditors[this.id] = this;
this.turnOff();
},

Expand Down

0 comments on commit d43ca5c

Please sign in to comment.