Merge pull request #684 from himanish-star/delete-btn-background-red

delete btn popup attached
This commit is contained in:
Danny Coates 2018-01-08 12:22:57 -08:00 committed by GitHub
commit 069f0e53e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 1 deletions

View File

@ -81,7 +81,23 @@ module.exports = function(state, emit) {
<button id="delete-file" <button id="delete-file"
class="btn" class="btn"
title="${state.translate('deleteFileButton')}" title="${state.translate('deleteFileButton')}"
onclick=${deleteFile}>${state.translate('deleteFileButton')}</button> onclick=${showPopup}>${state.translate('deleteFileButton')}
<div class="popup">
<div class="popuptext" onblur=${cancel} tabindex="-1">
<div class="popup-message">${state.translate(
'deletePopupText'
)}</div>
<div class="popup-action">
<span class="popup-no" onclick=${cancel}>${state.translate(
'deletePopupCancel'
)}</span>
<span class="popup-yes" onclick=${deleteFile}>${state.translate(
'deletePopupYes'
)}</span>
</div>
</div>
</div>
</button>
<a class="send-new" <a class="send-new"
data-state="completed" data-state="completed"
href="/" href="/"
@ -90,6 +106,17 @@ module.exports = function(state, emit) {
</div> </div>
`; `;
function showPopup() {
const popupText = document.querySelector('.popuptext');
popupText.classList.add('show');
}
function cancel(e) {
e.stopPropagation();
const popupText = e.target.parentElement.parentElement;
popupText.classList.remove('show');
}
async function sendNew(e) { async function sendNew(e) {
e.preventDefault(); e.preventDefault();
await fadeOut('share-link'); await fadeOut('share-link');