Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Allow disabling selection when loading a note. #24
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Sep 20, 2014
1 parent 8c23282 commit a4e0de8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,11 @@ function selectItem(id)
/**
* Displays a note from cache and selects it in the list.
* @param {id} id Note ID.
* @param {boolean} select If true, highlights the loaded note in the list.
*/
function loadNote(id)
function loadNote(id, select)
{
select = typeof select !== "undefined" ? select : true;
current = id;
if (!noteCache[id])
{
Expand All @@ -673,8 +675,10 @@ function loadNote(id)
markdown = noteCache[id];
$("#display").html(markdown);
note = notes[id];
// [todo] - Need to make sure selectItem isn't ran multiple times.
selectItem(id);
if (select)
{
selectItem(id);
}
}

/**
Expand Down

0 comments on commit a4e0de8

Please sign in to comment.