Skip to content

Commit

Permalink
Transparent the original note when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasdelellis committed Aug 14, 2019
1 parent f466390 commit ac22e7f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
background:#333;
}

.any-color {
background-color: transparent;
}

/* Isotope Grid */

.notes-grid {
Expand Down
15 changes: 15 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ View.prototype = {
'autolist': autolist
}
});

/*
var shareSelect = $('.note-share-select');
shareSelect.select2({
Expand Down Expand Up @@ -249,6 +250,7 @@ View.prototype = {
*/

/* Positioning the modal to the original size */

$(".modal-content").css({
"position" : "absolute",
"left" : note.offset().left,
Expand All @@ -259,8 +261,12 @@ View.prototype = {
});

/* Animate to center */

modal.removeClass("hide-modal-note");
modal.addClass("show-modal-note");

note.css({"opacity": "0.1"});

$(".modal-content").animate (
{
left: ($(window).width() / 2 - note.width()),
Expand All @@ -269,6 +275,7 @@ View.prototype = {
},
250,
function () {
MediumEditor.selection.clearSelection(document, false);
modalcontent.focus();
}
);
Expand Down Expand Up @@ -323,6 +330,9 @@ View.prototype = {
var modaltitle = $('#modal-note-div #title-editable');
var modalcontent = $('#modal-note-dive #content-editable');
var modalnote = $("#modal-note-div .quicknote");

var id = $("#modal-note-div .quicknote").data('id');

//remove checkmark icons from temp selected color
var modalcolortools = $("#modal-note-div .circle-toolbar");
$.each(modalcolortools, function(i, colortool) {
Expand All @@ -343,6 +353,9 @@ View.prototype = {
modalnote.data('id', -1);
modaltitle.html("");
modalcontent.html("");

var note = $('.notes-grid [data-id=' + id + ']').parent();
note.css({"opacity": ""});
},
renderContent: function () {
// Remove all event handlers to prevent double events.
Expand Down Expand Up @@ -408,9 +421,11 @@ View.prototype = {
// Handle hotkeys
$(document).keyup(function(event) {
if (event.keyCode == 27) {
event.stopPropagation();
self.cancelEdit();
}
else if (event.keyCode == 13 && event.altKey) {
event.stopPropagation();
self.saveNote();
}
});
Expand Down

0 comments on commit ac22e7f

Please sign in to comment.