X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/cb800d0ee02280d6e2663cf0524fb74681c8173e..c66ddb7dbe763b261c7dd4a037239a667f60cd95:/modules/documentHistory/documentHistory.js diff --git a/modules/documentHistory/documentHistory.js b/modules/documentHistory/documentHistory.js index c90c879..0db2a75 100644 --- a/modules/documentHistory/documentHistory.js +++ b/modules/documentHistory/documentHistory.js @@ -15,11 +15,14 @@ return function(sandbox) { } var itemViews = []; - var addHistoryItem = function(item) { + var addHistoryItem = function(item, options) { historyItems.add(item); var view = new itemView(item); itemViews.push(view); domNodes.itemList.prepend(view.dom); + if(options.animate) { + view.dom.hide().slideDown(); + } } var toggleItemViews = function(toggle) { @@ -80,10 +83,10 @@ return function(sandbox) { return { - start: function() { sandbox.publish('ready'); }, - addHistory: function(history) { + start: function() { sandbox.publish('ready'); }, + addHistory: function(history, options) { history.forEach(function(historyItem) { - addHistoryItem(historyItem); + addHistoryItem(historyItem, options || {}); }); }, getView: function() {