immediately replace user image on change

This commit is contained in:
Dennis Eichhorn 2020-06-10 21:51:55 +02:00
parent e92aac8547
commit 5a32d19a51

View File

@ -66,7 +66,7 @@ echo $this->getData('nav')->render();
</div>
<div class="portlet-body">
<span class="rf">
<div><img class="m-profile rf"
<div><img id="preview-profileImage" class="m-profile rf"
alt="<?= $this->getHtml('ProfileImage'); ?>"
itemprop="logo"
data-lazyload="<?=
@ -76,7 +76,7 @@ echo $this->getData('nav')->render();
width="100px"></div>
<?php if ($this->request->getHeader()->getAccount() === $account->getId()) : ?>
<div><a id="iProfileUploadButton" href="#upload" data-action='[{"listener": "click", "key": 1, "action": [{"key": 1, "type": "event.prevent"}, {"key": 2, "type": "dom.click", "selector": "#iProfileUpload"}]}]'>Change</a>
<form id="iProfileUploadForm" action="<?= UriFactory::build('{/api}profile/settings/image'); ?>" method="post"><input data-action='[{"listener": "change", "key": 1, "action": [{"key": 1, "type": "form.submit", "selector": "#iProfileUploadForm"}]}]' id="iProfileUpload" name="profileImage" type="file" accept="image/png,image/gif,image/jpeg" style="display: none;"></form></div>
<form id="iProfileUploadForm" action="<?= UriFactory::build('{/api}profile/settings/image'); ?>" method="post"><input class="preview" data-action='[{"listener": "change", "key": 1, "action": [{"key": 1, "type": "form.submit", "selector": "#iProfileUploadForm"}]}]' id="iProfileUpload" name="profileImage" type="file" accept="image/png,image/gif,image/jpeg" style="display: none;"></form></div>
<?php endif; ?>
</span>
<table class="list" style="table-layout: fixed">