mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
Merge pull request #2 from v1r0x/highlight-selected-co
highlight current color, only on entering edit mode
This commit is contained in:
16
js/script.js
16
js/script.js
@@ -163,6 +163,12 @@ View.prototype = {
|
|||||||
var title = note.find("#title-editable").html();
|
var title = note.find("#title-editable").html();
|
||||||
var content = note.find("#content-editable").html();
|
var content = note.find("#content-editable").html();
|
||||||
var color = note.children().css("background-color");
|
var color = note.children().css("background-color");
|
||||||
|
var colors = modal[0].getElementsByClassName("circle-toolbar");
|
||||||
|
$.each(colors, function(i, c) {
|
||||||
|
if(color == c.style.backgroundColor) {
|
||||||
|
c.className += " icon-checkmark";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var modalid = modalnote.data('id');
|
var modalid = modalnote.data('id');
|
||||||
|
|
||||||
@@ -192,6 +198,11 @@ 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");
|
||||||
|
//remove checkmark icons from temp selected color
|
||||||
|
var modalcolortools = $("#modal-note-div .circle-toolbar");
|
||||||
|
$.each(modalcolortools, function(i, colortool) {
|
||||||
|
$(colortool).removeClass('icon-checkmark');
|
||||||
|
});
|
||||||
|
|
||||||
this._notes.unsetActive();
|
this._notes.unsetActive();
|
||||||
|
|
||||||
@@ -300,6 +311,11 @@ View.prototype = {
|
|||||||
$('#app-content .circle-toolbar').click(function (event) {
|
$('#app-content .circle-toolbar').click(function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
|
var oldColorTool = $('.circle-toolbar.icon-checkmark');
|
||||||
|
$.each(oldColorTool, function(i, oct) {
|
||||||
|
$(oct).removeClass('icon-checkmark');
|
||||||
|
});
|
||||||
|
$(this).addClass('icon-checkmark');
|
||||||
var color = $(this).css("background-color");
|
var color = $(this).css("background-color");
|
||||||
modalnote.css("background-color", color);
|
modalnote.css("background-color", color);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user