Skip to content

Commit

Permalink
fixed issue with pastebin test not working on IE/Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
spocke committed Apr 17, 2018
1 parent 11fae76 commit cf05d84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/plugins/paste/main/ts/core/PasteBin.ts
Expand Up @@ -154,7 +154,7 @@ const isDefault = (editor, pasteBinDefaultContent) => {
return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML);
};

export interface PasteBin {
interface PasteBin {
create: () => void;
remove: () => void;
getEl: () => HTMLElement;
Expand All @@ -169,7 +169,7 @@ export interface PasteBin {
* @private
*/

export const PasteBin = (editor): PasteBin => {
const PasteBin = (editor): PasteBin => {
const lastRng = Cell(null);
const pasteBinDefaultContent = '%MCEPASTEBIN%';

Expand All @@ -182,4 +182,9 @@ export const PasteBin = (editor): PasteBin => {
isDefault: () => isDefault(editor, pasteBinDefaultContent),
isDefaultContent: (content) => isDefaultContent(pasteBinDefaultContent, content)
};
};
};

export {
PasteBin,
getPasteBinParent
};
4 changes: 2 additions & 2 deletions src/plugins/paste/test/ts/browser/PasteBinTest.ts
Expand Up @@ -3,7 +3,7 @@ import { UnitTest } from '@ephox/bedrock';
import { Id, Merger, Obj } from '@ephox/katamari';

import EditorManager from 'tinymce/core/api/EditorManager';
import { PasteBin } from 'tinymce/plugins/paste/core/PasteBin';
import { PasteBin, getPasteBinParent } from 'tinymce/plugins/paste/core/PasteBin';
import PastePlugin from 'tinymce/plugins/paste/Plugin';
import Theme from 'tinymce/themes/modern/Theme';

Expand Down Expand Up @@ -70,7 +70,7 @@ UnitTest.asynctest('tinymce.plugins.paste.browser.PasteBin', function () {
return Chain.op(function (editor) {
const pasteBin = PasteBin(editor);
Obj.each(cases, function (c, i) {
editor.getBody().innerHTML = c.content;
getPasteBinParent(editor).appendChild(editor.dom.createFragment(c.content));
Assertions.assertEq(c.label || 'Asserting paste bin case ' + i, c.result, pasteBin.getHtml());
pasteBin.remove();
});
Expand Down

0 comments on commit cf05d84

Please sign in to comment.