fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
diffViewer: selecting tab with the latest requested diff
[fnpeditor.git]
/
modules
/
documentHistory
/
documentHistory.js
diff --git
a/modules/documentHistory/documentHistory.js
b/modules/documentHistory/documentHistory.js
index
61eec9e
..
0693469
100644
(file)
--- a/
modules/documentHistory/documentHistory.js
+++ b/
modules/documentHistory/documentHistory.js
@@
-14,6
+14,12
@@
return function(sandbox) {
itemList: dom.find('.rng-module-documentHistory-itemsList'),
\r
}
\r
var itemViews = [];
\r
itemList: dom.find('.rng-module-documentHistory-itemsList'),
\r
}
\r
var itemViews = [];
\r
+
\r
+
\r
+ dom.find('.btn.compare').click(function(e) {
\r
+ var selected = historyItems.getSelected();
\r
+ sandbox.publish('compare', selected[0], selected[1]);
\r
+ });
\r
\r
var addHistoryItem = function(item, options) {
\r
historyItems.add(item);
\r
\r
var addHistoryItem = function(item, options) {
\r
historyItems.add(item);
\r
@@
-27,7
+33,7
@@
return function(sandbox) {
\r
var toggleItemViews = function(toggle) {
\r
itemViews.forEach(function(view) {
\r
\r
var toggleItemViews = function(toggle) {
\r
itemViews.forEach(function(view) {
\r
- if(!historyItems.
s
elected(view.item))
\r
+ if(!historyItems.
isS
elected(view.item))
\r
view.toggle(toggle);
\r
});
\r
}
\r
view.toggle(toggle);
\r
});
\r
}
\r
@@
-54,9
+60,12
@@
return function(sandbox) {
add: function(item) {
\r
this._itemsById[item.version] = item;
\r
},
\r
add: function(item) {
\r
this._itemsById[item.version] = item;
\r
},
\r
-
s
elected: function(item) {
\r
+
isS
elected: function(item) {
\r
return _.contains(this._selected, item.version);
\r
},
\r
return _.contains(this._selected, item.version);
\r
},
\r
+ getSelected: function() {
\r
+ return this._selected;
\r
+ },
\r
_updateUI: function() {
\r
var len = this._selected.length;
\r
if(len === 0) {
\r
_updateUI: function() {
\r
var len = this._selected.length;
\r
if(len === 0) {
\r
@@
-88,7
+97,7
@@
return function(sandbox) {
};
\r
itemView.prototype.template = _.template(itemTemplateSrc);
\r
itemView.prototype.onItemClicked = function() {
\r
};
\r
itemView.prototype.template = _.template(itemTemplateSrc);
\r
itemView.prototype.onItemClicked = function() {
\r
- if(historyItems.
s
elected(this.item)) {
\r
+ if(historyItems.
isS
elected(this.item)) {
\r
historyItems.unselect(this.item);
\r
this.dimItem();
\r
} else if(historyItems.select(this.item)) {
\r
historyItems.unselect(this.item);
\r
this.dimItem();
\r
} else if(historyItems.select(this.item)) {
\r