});\r
dialog.show();\r
});\r
+ \r
+ dom.find('.btn.display').click(function(e) {\r
+ sandbox.publish('displayVersion', {version: historyItems.getSelected()[0]});\r
+ });\r
\r
var addHistoryItem = function(item, options) {\r
historyItems.add(item);\r
var len = this._selected.length;\r
if(len === 0) {\r
toggleButton('compare', false);\r
- toggleButton('show2', false);\r
+ toggleButton('display', false);\r
toggleButton('restore', false);\r
}\r
if(len === 1) {\r
toggleButton('compare', false);\r
- toggleButton('show2', true);\r
+ toggleButton('display', true);\r
toggleButton('restore', true);\r
}\r
if(len === 2) {\r
toggleItemViews(false);\r
toggleButton('compare', true);\r
- toggleButton('show2', false);\r
+ toggleButton('display', false);\r
toggleButton('restore', false);\r
} else {\r
toggleItemViews(true);\r
<div class="group">\r
<button class="btn btn-mini compare">Porównaj</button>\r
<button class="btn btn-mini restore">Przywróć</button>\r
- <button class="btn btn-mini show2">Zobacz</button>\r
+ <button class="btn btn-mini display">Zobacz</button>\r
</div>\r
</div>\r
<div style="clear:both;"></div>\r
},\r
restoreVersion: function(event) {\r
sandbox.getModule('data').restoreVersion(event);\r
+ },\r
+ displayVersion: function(event) {\r
+ window.open('/' + gettext('editor') + '/' + sandbox.getModule('data').getDocumentId() + '?version=' + event.version, _.uniqueId());\r
}\r
}\r
\r