diff --git a/src/blockly/blockly-worksace.js b/src/blockly/blockly-worksace.js index 3a5d27169..87e926349 100644 --- a/src/blockly/blockly-worksace.js +++ b/src/blockly/blockly-worksace.js @@ -133,37 +133,8 @@ const setElementActions = blockly => { addEventHandlers(blockly); }; -const exportContent = { - 'summary-panel': () => { - globalObserver.emit('summary.export'); - }, - logPanel: () => { - globalObserver.emit('log.export'); - }, -}; - -const addExportButtonToPanel = panelId => { - const buttonHtml = - ''; - const $button = $(buttonHtml); - const panelSelector = `[aria-describedby="${panelId}"]`; - if (!$(`${panelSelector} .icon-save`).length) { - $button.insertBefore(`${panelSelector} .icon-close`); - $(`${panelSelector} .icon-close`).blur(); - $($(`${panelSelector} .icon-save`)).click(() => { - exportContent[panelId](); - }); - } -}; - export const showSummary = () => { - $('#summary-panel').dialog('option', 'minWidth', 770).dialog('open'); - addExportButtonToPanel('summary-panel'); -}; - -export const logButton = () => { - $('#logPanel').dialog('open'); - addExportButtonToPanel('logPanel'); + globalObserver.emit('summary.show'); }; const addBindings = blockly => { @@ -271,14 +242,6 @@ const addBindings = blockly => { }, 300) ); - $('[aria-describedby="summary-panel"]').on('click', '#summaryRunButton', () => { - $('#runButton').trigger('click'); - }); - - $('[aria-describedby="summary-panel"]').on('click', '#summaryStopButton', () => { - $('#stopButton').trigger('click'); - }); - globalObserver.register('ui.switch_account', () => { stopBlockly(blockly); GTM.setVisitorId(); diff --git a/src/blockly/bot/tools.js b/src/blockly/bot/tools.js index 0cda76f67..1b978e12e 100644 --- a/src/blockly/bot/tools.js +++ b/src/blockly/bot/tools.js @@ -182,8 +182,15 @@ export const createDetails = (contract, pip_size) => { export const getUUID = () => `${new Date().getTime() * Math.random()}`; -export const showDialog = options => - new Promise((resolve, reject) => { +export const showDialog = options => { + const draggableModals = document.getElementsByClassName('draggable'); + if (draggableModals.length) { + Array.from(draggableModals).forEach(dialog => { + dialog.style.zIndex = 100; + }); + } + + return new Promise((resolve, reject) => { const $dialog = $('
', { class: `draggable-dialog ${options.className}`, title: options.title }); options.text.forEach(text => $dialog.append(`${text}
`)); const defaultButtons = [ @@ -223,3 +230,4 @@ export const showDialog = options => $dialog.dialog(dialogOptions); $dialog.dialog('open'); }); +}; diff --git a/src/botPage/view/TradeInfoPanel/RunButton.js b/src/botPage/view/TradeInfoPanel/RunButton.js index bcc5437c8..5a73f0b52 100644 --- a/src/botPage/view/TradeInfoPanel/RunButton.js +++ b/src/botPage/view/TradeInfoPanel/RunButton.js @@ -3,12 +3,22 @@ import { translate } from '@i18n'; const RunButton = () => (