views.mainTabs.addTab(title, slug, view);\r
}\r
\r
- function tabIsDirty(slug) {\r
- if(slug === 'editor' && (dirty.documentCanvas || dirty.metadataEditor))\r
- return true;\r
- if(slug === 'sourceEditor' && dirty.sourceEditor)\r
- return true;\r
- return false;\r
- }\r
- \r
var dirty = {\r
sourceEditor: false,\r
documentCanvas: false,\r
};\r
\r
var synchronizeTab = function(slug) {\r
+ function tabIsDirty(slug) {\r
+ if(slug === 'editor' && (dirty.documentCanvas || dirty.metadataEditor))\r
+ return true;\r
+ if(slug === 'sourceEditor' && dirty.sourceEditor)\r
+ return true;\r
+ return false;\r
+ }\r
+ \r
if(tabIsDirty(slug)) {\r
if(slug === 'sourceEditor') {\r
sandbox.getModule('data').commitDocument(sandbox.getModule('sourceEditor').getDocument(), 'source_edit');\r