jupyter-js-filebrowser
Advanced tools
Comparing version 0.3.10 to 0.3.11
@@ -878,23 +878,23 @@ // Copyright (c) Jupyter Development Team. | ||
} | ||
Private.createIconClass = createIconClass; | ||
/** | ||
* Create the text node content for an IContentsModel. | ||
*/ | ||
function createTextContent(item) { | ||
return item.name; | ||
function populateText(item, node) { | ||
node.textContent = item.name; | ||
} | ||
Private.createTextContent = createTextContent; | ||
/** | ||
* Create the last modified node content for an IContentsModel. | ||
*/ | ||
function createModifiedContent(item) { | ||
function populateModified(item, node) { | ||
if (item.last_modified) { | ||
var text = moment(item.last_modified).fromNow(); | ||
return text === 'a few seconds ago' ? 'seconds ago' : text; | ||
text === 'a few seconds ago' ? 'seconds ago' : text; | ||
node.textContent = text; | ||
node.title = moment(item.last_modified).format("YYYY-MM-DD HH:mm"); | ||
} | ||
else { | ||
return ''; | ||
node.textContent = ''; | ||
node.title = ''; | ||
} | ||
} | ||
Private.createModifiedContent = createModifiedContent; | ||
/** | ||
@@ -908,4 +908,4 @@ * Update the node state for an IContentsModel. | ||
icon.className = createIconClass(item); | ||
text.textContent = createTextContent(item); | ||
modified.textContent = createModifiedContent(item); | ||
populateText(item, text); | ||
populateModified(item, modified); | ||
node.classList.remove(SELECTED_CLASS); | ||
@@ -912,0 +912,0 @@ node.classList.remove(CUT_CLASS); |
{ | ||
"name": "jupyter-js-filebrowser", | ||
"version": "0.3.10", | ||
"version": "0.3.11", | ||
"description": "File browser widget for Jupyter", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
111924