X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/f61fd6fa1d5871782b079ee50fb6bb10777cadc2..969f365b3ee6d3cb54f98b23e1ebb97df9f801dd:/modules/diffViewer/diffViewer.js?ds=sidebyside diff --git a/modules/diffViewer/diffViewer.js b/modules/diffViewer/diffViewer.js index 254a19a..12e022a 100644 --- a/modules/diffViewer/diffViewer.js +++ b/modules/diffViewer/diffViewer.js @@ -14,11 +14,12 @@ return function(sandbox) { dom.append(tabsView.getAsView()); var DiffView = function() { - this.dom = $(diffTemplateSrc) - } + this.dom = $(diffTemplateSrc); + }; + DiffView.prototype.setTable = function(table) { this.dom.append(table); - } + }; return { @@ -27,7 +28,9 @@ return function(sandbox) { setDiff: function(diff) { var diffView = new DiffView(); diffView.setTable(diff.table); - tabsView.addTab(diff.ver1 + '->' + diff.ver2, diff.ver1 + '-' + diff.ver2, diffView.dom); + var slug = diff.ver1 + '-' + diff.ver2; + tabsView.addTab(diff.ver1 + '->' + diff.ver2, slug, diffView.dom); + tabsView.selectTab(slug); } }; };