history wip: little animation on adding new item
[fnpeditor.git] / modules / rng / rng.js
index 992d601..9abe00c 100644 (file)
@@ -108,7 +108,7 @@ return function(sandbox) {
         ready: function() {\r
             views.mainLayout.setView('mainView', views.mainTabs.getAsView());\r
             \r
-            _.each(['sourceEditor', 'documentCanvas', 'documentToolbar', 'nodePane', 'metadataEditor', 'nodeFamilyTree', 'nodeBreadCrumbs', 'mainBar', 'indicator'], function(moduleName) {\r
+            _.each(['sourceEditor', 'documentCanvas', 'documentToolbar', 'nodePane', 'metadataEditor', 'nodeFamilyTree', 'nodeBreadCrumbs', 'mainBar', 'indicator', 'documentHistory'], function(moduleName) {\r
                 sandbox.getModule(moduleName).start();\r
             });\r
         },\r
@@ -130,6 +130,9 @@ return function(sandbox) {
         savingEnded: function(status) {\r
             sandbox.getModule('mainBar').setCommandEnabled('save', true);\r
             sandbox.getModule('indicator').clearMessage();\r
+        },\r
+        historyItemAdded: function(item) {\r
+            sandbox.getModule('documentHistory').addHistory([item], {animate: true});\r
         }\r
     }\r
     \r
@@ -246,6 +249,13 @@ return function(sandbox) {
         }        \r
     }\r
     \r
+    eventHandlers.documentHistory = {\r
+        ready: function() {\r
+            sandbox.getModule('documentHistory').addHistory(sandbox.getModule('data').getHistory());\r
+            addMainTab('Historia', 'history', sandbox.getModule('documentHistory').getView());\r
+        }\r
+    }\r
+    \r
     /* api */\r
     \r
     return {\r