diff --git a/js/detail.js b/js/detail.js index 5a8839f..21db8b4 100644 --- a/js/detail.js +++ b/js/detail.js @@ -447,9 +447,12 @@ function loadHeader(project) { document.getElementById("export" + project['name']).onclick = function() { electron.remote.dialog.showSaveDialog(function(filename, bookmark) { database.get_images_in_project(project['name'], function(projName, rows) { - database.get_metadata_fields(function(columns) { + database.get_favorite_fields(function(_, columns_dup) { /* Create CSV Header. */ var csvString = ""; + var columns = columns_dup.filter(function(item, pos) { + return columns_dup.indexOf(item) == pos; + }) columns.forEach(function(col) { csvString += col + ", "; }); @@ -502,7 +505,6 @@ function insertDetailTemplate(img_name, img_path, proj_name) { function insertDetailTemplate__NEW(data, id, path, projname) { data.displayName = withspaces(data.name) - insertIntoSlideMenu(data, id); data.id = id; if (data.error) { @@ -558,12 +560,18 @@ function insertDetailTemplate__NEW(data, id, path, projname) { var mediacontents if (data.media != 'pdf') { mediacontents = '<{{media}} class="img-responsive rounded" src="{{path}}" alt="' + data.sorry + '" controls>' + data.thumbcontents = '<{{media}} class="img-responsive rounded thumb" src="{{path}}" alt="{{displayName}}" controls>' } else { //mediacontents = '

' + data.sorry + '

' var path_nospace = data.path.replace(/ /g, '%20') console.log(path_nospace) - mediacontents = "" + mediacontents = '' + data.thumbcontents = '' } + + insertIntoSlideMenu(data, id); + + var template = [ '
', '
', @@ -825,7 +833,7 @@ function insertIntoSlideMenu(data, id) { '
', '', '
', - '{{name}}', + data.thumbcontents, '
', '
', ].join('\n') diff --git a/main.js b/main.js index 091de14..a7c936f 100644 --- a/main.js +++ b/main.js @@ -61,13 +61,15 @@ if (app) { // Quit when all windows are closed. app.on('window-all-closed', function () { + app.quit() + db.close() // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q - if (process.platform !== 'darwin') { - app.quit() - db.close() - } + // if (process.platform !== 'darwin') { + // app.quit() + // db.close() + // } }) app.on('activate', function () {