pixel-editor/js/_createButton.js

26 lines
858 B
JavaScript
Raw Normal View History

2019-03-27 02:20:54 +03:00
on('click', 'create-button', function (){
2020-04-04 10:41:56 +03:00
var width = getValue('size-width');
var height = getValue('size-height');
var mode = getValue("editor-mode");
2020-07-21 00:33:17 +03:00
newPixel(width, height, mode);
2020-04-04 10:41:56 +03:00
document.getElementById('new-pixel-warning').style.display = 'block';
//get selected palette name
var selectedPalette = getText('palette-button');
if (selectedPalette == 'Choose a palette...')
selectedPalette = 'none';
//track google event
2019-03-27 02:20:54 +03:00
ga('send', 'event', 'Pixel Editor New', selectedPalette, width+'/'+height); /*global ga*/
2020-04-04 10:41:56 +03:00
//reset new form
setValue('size-width', 64);
setValue('size-height', 64);
setValue("editor-mode", 'Advanced')
setText('editor-mode-button', 'Choose a mode...');
2020-04-04 10:41:56 +03:00
setText('palette-button', 'Choose a palette...');
setText('preset-button', 'Choose a preset...');
});