/* adress editor initiator */ function _e(s){ console.log(s); } function starteditor(){ _e('starteditor()'); var itemid = document.querySelector('[data-itemid]').dataset.itemid; return document.location.href = '/dashboard/editor/adressmodel/'+itemid; var s = document.createElement('script'); s.src = '/api/svgedit/adressobj'; /*adressobj.js*/ document.body.appendChild(s); s.onload = function(){ var s = document.createElement('script'); s.src = '/api/svgedit/adressedit'; /*adress-editor-user.js*/ document.body.appendChild(s); } } function addbutton(){ _e('addbutton()'); var b = document.createElement('button'); b.type='button'; //b.classList.add('btn'); //b.classList.add('btn-light'); b.classList.add('tools-input-toedit'); b.id='starteditor_button'; b.innerHTML = '   Изменить / Заказать →'; b.addEventListener('click', starteditor); document.querySelector('.img_preview-holder').appendChild(b); } document.addEventListener('DOMContentLoaded',addbutton);