diff --git a/public/js/printer.js b/public/js/printer.js index 05e75b7..cc1d22f 100755 --- a/public/js/printer.js +++ b/public/js/printer.js @@ -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'); };