Skip to content

Commit 36d74c1

Browse files
committed
Return to all or group after closing note.
1 parent 38ad043 commit 36d74c1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

js/script.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@
9090
html += "</div>";
9191
document.getElementById("ownnote").innerHTML = html;
9292
tinymceInit();
93-
buildNav(g);
94-
listingtype = g;
95-
buildGroupSelectOptions();
93+
buildGroupSelectOptions(g);
9694
bindEdit();
9795
}
9896

@@ -166,8 +164,7 @@
166164
$.get(url, function(data) {
167165
filelist = data;
168166
listing = jQuery.parseJSON(filelist);
169-
buildNav('All');
170-
listingtype = "All";
167+
buildNav(listingtype);
171168
buildListing();
172169
if (switchgroup != "") {
173170
$("[id='link-"+switchgroup+"']").click();
@@ -276,17 +273,17 @@
276273
}
277274
document.getElementById("ownnote").innerHTML = html;
278275
$('#newfilename').css('color', '#A0A0A0');
279-
buildGroupSelectOptions();
276+
buildGroupSelectOptions(listingtype);
280277
bindListing();
281278
}
282279

283-
function buildGroupSelectOptions() {
280+
function buildGroupSelectOptions(current) {
284281
var $select = $('select#groupname');
285282
$select.append($('<option value="">Not grouped</option>'));
286283
$select.append($('<option>').attr('value', '_new').text('New group'));
287284
$(groups).each(function(i, group) {
288285
var option = $('<option>').attr('value', group).text(group);
289-
if(group == listingtype) {
286+
if(group == current) {
290287
option.attr('selected', 'selected');
291288
}
292289
$select.append(option);
@@ -403,6 +400,7 @@
403400

404401
var groups = new Array();
405402
var counts = new Array();
403+
406404
function buildNav(a) {
407405
groups.length = 0;
408406
counts.length = 0;

0 commit comments

Comments
 (0)