mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Implement remove attachments.
This commit is contained in:
31
js/script.js
31
js/script.js
@@ -422,6 +422,13 @@ View.prototype = {
|
||||
}
|
||||
});
|
||||
|
||||
// Pin note in modal
|
||||
$('#modal-note-div').on("click", ".attach-remove", function (event) {
|
||||
event.stopPropagation();
|
||||
$(this).parent().remove();
|
||||
self._resizeAttachtsModal();
|
||||
});
|
||||
|
||||
// Pin note in modal
|
||||
$('#modal-note-div').on("click", ".icon-pin", function (event) {
|
||||
event.stopPropagation();
|
||||
@@ -723,17 +730,23 @@ View.prototype = {
|
||||
$("#modal-note-div .note-attachts").replaceWith(html);
|
||||
|
||||
lozad('.attach-preview').observe();
|
||||
|
||||
var sAttachts = $('#modal-note-div .note-attach-grid');
|
||||
sAttachts.parent().css('height', (500/sAttachts.length) + 'px');
|
||||
sAttachts.first().children().css('border-top-left-radius', '8px');
|
||||
sAttachts.each(function(index) {
|
||||
$(this).css('width', (100/sAttachts.length) + '%');
|
||||
$(this).css('left', (100/sAttachts.length)*index + '%');
|
||||
});
|
||||
sAttachts.last().children().css('border-top-right-radius', '8px');
|
||||
this._resizeAttachtsModal();
|
||||
}
|
||||
},
|
||||
_resizeAttachtsModal: function() {
|
||||
var sAttachts = $('#modal-note-div .note-attach-grid');
|
||||
if (sAttachts.length === 0) {
|
||||
$('#modal-note-div .note-attachts').css('height','');
|
||||
return;
|
||||
}
|
||||
sAttachts.parent().css('height', (500/sAttachts.length) + 'px');
|
||||
sAttachts.first().children().first().css('border-top-left-radius', '8px');
|
||||
sAttachts.each(function(index) {
|
||||
$(this).css('width', (100/sAttachts.length) + '%');
|
||||
$(this).css('left', (100/sAttachts.length)*index + '%');
|
||||
});
|
||||
sAttachts.last().children().first().css('border-top-right-radius', '8px');
|
||||
},
|
||||
_resizeAttachtsGrid: function() {
|
||||
var attachtsgrids = $('#notes-grid-div .note-attachts');
|
||||
attachtsgrids.each(function() {
|
||||
|
||||
Reference in New Issue
Block a user