Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
https://github.com/binjospookie/--shots/issues/11
Browse files Browse the repository at this point in the history
  • Loading branch information
binjospookie committed Dec 21, 2016
1 parent da07cf0 commit be2cf1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
12 changes: 11 additions & 1 deletion scripts/functions/sendToServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ const popUp = require('./popUp');
const popupWindow = document.querySelector('aside#messageToUser');
const popupText = popupWindow.querySelector('p');

const xhr = new XMLHttpRequest();

module.exports = function sendToServer(code, old, loader, loaderText, path) {
const data = new FormData();
const xhr = new XMLHttpRequest()
let now;
let difference;
let callAfter;
Expand Down Expand Up @@ -69,4 +70,13 @@ module.exports = function sendToServer(code, old, loader, loaderText, path) {
break;
}
};

window.addEventListener('keydown', event => {
if (event.which === 27) {
if (loader.classList.contains('show')) {
xhr.abort();
hideLoader(3000, 'Abort', loaderText);
}
}
});
};
19 changes: 9 additions & 10 deletions scripts/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ textEventListeners(textareaContent, textateaFontSize, textateaFontColor, textare

/**
* Обработчик закртыия формы с текстом
* @return {[type]} [description]
* @return {[type]}
*/
function applyTextButtonClickHandler() {
hideControls(activeShape, stage);
Expand All @@ -199,7 +199,7 @@ function applyTextButtonClickHandler() {

/**
* Обработчик удаления текста из формы
* @return {[type]} [description]
* @return {[type]}
*/
function deleteTextButtonClickHandler() {
stage.removeChild(activeShape);
Expand All @@ -209,8 +209,8 @@ function deleteTextButtonClickHandler() {
}
/**
* Обработчик изменения контента текста
* @param {[type]} event [description]
* @return {[type]} [description]
* @param {[type]} event
* @return {[type]}
*/
function textareaValueChangeHadler(event) {
let textareaValue = event.target.value;
Expand All @@ -221,8 +221,8 @@ function textareaValueChangeHadler(event) {

/**
* Обработчик изменения кегля
* @param {[type]} event [description]
* @return {[type]} [description]
* @param {[type]} event
* @return {[type]}
*/
function textareaFontSizeChangeHadler(event) {
let textareaFontSize = event.target.value;
Expand All @@ -235,8 +235,8 @@ function textareaFontSizeChangeHadler(event) {

/**
* Обработчик изменения текста
* @param {[type]} event [description]
* @return {[type]} [description]
* @param {[type]} event
* @return {[type]}
*/
function textareaFontColorChangeHadler(event) {
let textareaColor = event.target.value;
Expand Down Expand Up @@ -701,7 +701,6 @@ function setDefaultSceneState() {
setDefaultFrame(frame);

// если жмём esc во время работы с фигурой
// добавить условие про crop
if (onCreate === true) {
mouseDownX = 0;
mouseDownY = 0;
Expand Down Expand Up @@ -1001,7 +1000,7 @@ function createText(oldEvent) {

/**
* Инициализация модалки при открытии
* @return {[type]} [description]
* @return {[type]}
*/
function openTextSidebar() {
const paragraph = activeShape.children[0];
Expand Down

0 comments on commit be2cf1a

Please sign in to comment.