Transparent the original note when editing

This commit is contained in:
Matias De lellis
2019-08-14 20:06:53 -03:00
parent f4663902a3
commit ac22e7f206
2 changed files with 19 additions and 0 deletions

View File

@@ -128,6 +128,10 @@
background:#333; background:#333;
} }
.any-color {
background-color: transparent;
}
/* Isotope Grid */ /* Isotope Grid */
.notes-grid { .notes-grid {

View File

@@ -220,6 +220,7 @@ View.prototype = {
'autolist': autolist 'autolist': autolist
} }
}); });
/* /*
var shareSelect = $('.note-share-select'); var shareSelect = $('.note-share-select');
shareSelect.select2({ shareSelect.select2({
@@ -249,6 +250,7 @@ View.prototype = {
*/ */
/* Positioning the modal to the original size */ /* Positioning the modal to the original size */
$(".modal-content").css({ $(".modal-content").css({
"position" : "absolute", "position" : "absolute",
"left" : note.offset().left, "left" : note.offset().left,
@@ -259,8 +261,12 @@ View.prototype = {
}); });
/* Animate to center */ /* Animate to center */
modal.removeClass("hide-modal-note"); modal.removeClass("hide-modal-note");
modal.addClass("show-modal-note"); modal.addClass("show-modal-note");
note.css({"opacity": "0.1"});
$(".modal-content").animate ( $(".modal-content").animate (
{ {
left: ($(window).width() / 2 - note.width()), left: ($(window).width() / 2 - note.width()),
@@ -269,6 +275,7 @@ View.prototype = {
}, },
250, 250,
function () { function () {
MediumEditor.selection.clearSelection(document, false);
modalcontent.focus(); modalcontent.focus();
} }
); );
@@ -323,6 +330,9 @@ View.prototype = {
var modaltitle = $('#modal-note-div #title-editable'); var modaltitle = $('#modal-note-div #title-editable');
var modalcontent = $('#modal-note-dive #content-editable'); var modalcontent = $('#modal-note-dive #content-editable');
var modalnote = $("#modal-note-div .quicknote"); var modalnote = $("#modal-note-div .quicknote");
var id = $("#modal-note-div .quicknote").data('id');
//remove checkmark icons from temp selected color //remove checkmark icons from temp selected color
var modalcolortools = $("#modal-note-div .circle-toolbar"); var modalcolortools = $("#modal-note-div .circle-toolbar");
$.each(modalcolortools, function(i, colortool) { $.each(modalcolortools, function(i, colortool) {
@@ -343,6 +353,9 @@ View.prototype = {
modalnote.data('id', -1); modalnote.data('id', -1);
modaltitle.html(""); modaltitle.html("");
modalcontent.html(""); modalcontent.html("");
var note = $('.notes-grid [data-id=' + id + ']').parent();
note.css({"opacity": ""});
}, },
renderContent: function () { renderContent: function () {
// Remove all event handlers to prevent double events. // Remove all event handlers to prevent double events.
@@ -408,9 +421,11 @@ View.prototype = {
// Handle hotkeys // Handle hotkeys
$(document).keyup(function(event) { $(document).keyup(function(event) {
if (event.keyCode == 27) { if (event.keyCode == 27) {
event.stopPropagation();
self.cancelEdit(); self.cancelEdit();
} }
else if (event.keyCode == 13 && event.altKey) { else if (event.keyCode == 13 && event.altKey) {
event.stopPropagation();
self.saveNote(); self.saveNote();
} }
}); });