Proper form reseting after printing.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var content, preview, selfPrinter;
|
||||
var content, title, preview, selfPrinter;
|
||||
var Printer = function () {
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ var Printer = function () {
|
||||
this.delete = document.querySelector('.js-delete');
|
||||
|
||||
content = this.content = document.querySelector('.js-content');
|
||||
title = this.title = document.querySelector('input[name="title"]');
|
||||
|
||||
|
||||
selfPrinter = this;
|
||||
@@ -32,7 +33,7 @@ var Printer = function () {
|
||||
/**
|
||||
* resetuje wybór ikony
|
||||
*/
|
||||
this.selectIcon = function(iconTitle){
|
||||
this.selectIcon = function (iconTitle) {
|
||||
document.querySelectorAll('.icon').forEach(function (e, i) {
|
||||
e.classList.remove('selected');
|
||||
});
|
||||
@@ -42,7 +43,7 @@ var Printer = function () {
|
||||
};
|
||||
|
||||
this.restoreContentHeight = function () {
|
||||
if(!!localStorage.getItem('contentHeight')){
|
||||
if (!!localStorage.getItem('contentHeight')) {
|
||||
document.querySelector('.js-content').style.height = localStorage.getItem('contentHeight')
|
||||
}
|
||||
};
|
||||
@@ -56,6 +57,7 @@ var Printer = function () {
|
||||
};
|
||||
|
||||
this.clear = function () {
|
||||
selfPrinter.title.value = '';
|
||||
selfPrinter.content.innerHTML = '';
|
||||
selfPrinter.selectIcon('empty');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user