fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
history wip: little animation on adding new item
[fnpeditor.git]
/
modules
/
documentHistory
/
documentHistory.js
diff --git
a/modules/documentHistory/documentHistory.js
b/modules/documentHistory/documentHistory.js
index
c90c879
..
0db2a75
100644
(file)
--- a/
modules/documentHistory/documentHistory.js
+++ b/
modules/documentHistory/documentHistory.js
@@
-15,11
+15,14
@@
return function(sandbox) {
}
\r
var itemViews = [];
\r
\r
}
\r
var itemViews = [];
\r
\r
- var addHistoryItem = function(item) {
\r
+ var addHistoryItem = function(item
, options
) {
\r
historyItems.add(item);
\r
var view = new itemView(item);
\r
itemViews.push(view);
\r
domNodes.itemList.prepend(view.dom);
\r
historyItems.add(item);
\r
var view = new itemView(item);
\r
itemViews.push(view);
\r
domNodes.itemList.prepend(view.dom);
\r
+ if(options.animate) {
\r
+ view.dom.hide().slideDown();
\r
+ }
\r
}
\r
\r
var toggleItemViews = function(toggle) {
\r
}
\r
\r
var toggleItemViews = function(toggle) {
\r
@@
-80,10
+83,10
@@
return function(sandbox) {
\r
\r
return {
\r
\r
\r
return {
\r
- start: function() { sandbox.publish('ready'); },
\r
- addHistory: function(history) {
\r
+ start: function() { sandbox.publish('ready'); },
+ addHistory: function(history
, options
) {
\r
history.forEach(function(historyItem) {
\r
history.forEach(function(historyItem) {
\r
- addHistoryItem(historyItem);
\r
+ addHistoryItem(historyItem
, options || {}
);
\r
});
\r
},
\r
getView: function() {
\r
});
\r
},
\r
getView: function() {
\r