Skip to content

Commit

Permalink
fix: wrong popup if editor is in from tag (fix #1059)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyuwoo.choi authored and seonim-ryu committed Jan 6, 2020
1 parent 5982616 commit 03923e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/editor/src/js/ui/codeBlockGadget.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CodeBlockGadget extends BlockOverlay {
this.$el.addClass('code-block-header');
this._$languageLabel = $('<span>text</span>');
this.$el.append(this._$languageLabel);
this._$buttonOpenModalEditor = $(`<button>Editor</button>`);
this._$buttonOpenModalEditor = $(`<button type="button">Editor</button>`);
this.$el.append(this._$buttonOpenModalEditor);
}

Expand Down
8 changes: 4 additions & 4 deletions apps/editor/src/js/ui/popupCodeBlockEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const CLASS_OK_BUTTON = 'te-ok-button';
const CLASS_CLOSE_BUTTON = 'te-close-button';
const CLASS_POPUP_CLOSE_BUTTON = 'tui-popup-close-button';
const TEMPLATE_HEADER_BUTTONS = `
<button class="${CLASS_PREFIX}toggle-scroll"></button>
<button class="${CLASS_PREFIX}toggle-preview"></button>
<button class="${CLASS_PREFIX}toggle-fit"></button>
<button class="${CLASS_POPUP_CLOSE_BUTTON}"></button>
<button type="button" class="${CLASS_PREFIX}toggle-scroll"></button>
<button type="button" class="${CLASS_PREFIX}toggle-preview"></button>
<button type="button" class="${CLASS_PREFIX}toggle-fit"></button>
<button type="button" class="${CLASS_POPUP_CLOSE_BUTTON}"></button>
`;

/**
Expand Down
10 changes: 5 additions & 5 deletions apps/editor/test/ui/layerpopup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ describe('LayerPopup', () => {
});

it('should open popup on click element having the class given to openerCssQuery', () => {
$('body').append($('<button class="button1 openPopup"></button>'));
$('body').append($('<button class="button2 openPopup"></button>'));
$('body').append($('<button type="button" class="button1 openPopup"></button>'));
$('body').append($('<button type="button" class="button2 openPopup"></button>'));

popup = new LayerPopup({
openerCssQuery: '.openPopup'
Expand All @@ -183,8 +183,8 @@ describe('LayerPopup', () => {
});

it('should close popup on click element having the class given to closerCssQuery', () => {
$('body').append($('<button class="button1 closePopup"></button>'));
$('body').append($('<button class="button2 closePopup"></button>'));
$('body').append($('<button type="button" class="button1 closePopup"></button>'));
$('body').append($('<button type="button" class="button2 closePopup"></button>'));

popup = new LayerPopup({
closerCssQuery: '.closePopup'
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('LayerPopup', () => {

describe('remove()', () => {
beforeEach(() => {
$('body').append($('<button class="button1 openPopup"></button>'));
$('body').append($('<button type="button" class="button1 openPopup"></button>'));

popup = new LayerPopup({
openerCssQuery: '.openPopup'
Expand Down
2 changes: 1 addition & 1 deletion apps/editor/test/ui/popupAddHeading.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('PopupAddHeading', () => {
em;

beforeEach(() => {
$('body').append('<button class="tui-heading"></button>');
$('body').append('<button type="button" class="tui-heading"></button>');

em = new EventManager();

Expand Down

0 comments on commit 03923e5

Please sign in to comment.