[DE] Add tooltip for Follow Move button in review changes

This commit is contained in:
Julia Radzhabova 2019-04-16 13:13:49 +03:00
parent d2e4a60427
commit 0dcc980e9f
3 changed files with 38 additions and 2 deletions

View file

@ -188,6 +188,7 @@ define([
this._state.posx = this._state.posy = -1000;
this._state.changes_length = 0;
this._state.popoverVisible = false;
this.getPopover().hideTips();
this.popoverChanges.reset();
this.getPopover().hideReview();
}

View file

@ -498,6 +498,26 @@ define([
itemTemplate: _.template(reviewTemplate)
});
var addtooltip = function (dataview, view, record) {
if (view.tipsArray) {
view.tipsArray.forEach(function (item) {
item.remove();
});
}
var arr = [],
btns = $(view.el).find('.btn-goto');
btns.tooltip({title: me.textFollowMove, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
view.tipsArray = arr;
};
this.reviewChangesView.on('item:add', addtooltip);
this.reviewChangesView.on('item:remove', addtooltip);
this.reviewChangesView.on('item:change', addtooltip);
this.reviewChangesView.on('item:click', function (picker, item, record, e) {
var btn = $(e.target);
if (btn) {
@ -508,6 +528,9 @@ define([
} else if (btn.hasClass('btn-delete')) {
me.fireEvent('reviewchange:delete', [record.get('changedata')]);
} else if (btn.hasClass('btn-goto')) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
me.fireEvent('reviewchange:goto', [record.get('changedata')]);
}
}
@ -826,6 +849,9 @@ define([
}
this.$window.css({overflow: ''});
if (this.scroller) {
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
}
},
saveText: function (clear) {
if (this.commentsView && this.commentsView.cmpEl.find('.lock-area').length < 1) {
@ -903,6 +929,14 @@ define([
});
}
}, this);
if (this.reviewChangesView)
_.each(this.reviewChangesView.dataViewItems, function (item) {
if (item.tipsArray) {
item.tipsArray.forEach(function (item) {
item.hide();
});
}
}, this);
},
isCommentsViewMouseOver: function () {
@ -952,7 +986,7 @@ define([
textReply : 'Reply',
textClose : 'Close',
textResolve : 'Resolve',
textOpenAgain : "Open Again"
textOpenAgain : "Open Again",
textFollowMove : 'Follow Move'
}, Common.Views.ReviewPopover || {}))
});

View file

@ -285,6 +285,7 @@
"Common.Views.ReviewPopover.textOpenAgain": "Open Again",
"Common.Views.ReviewPopover.textReply": "Reply",
"Common.Views.ReviewPopover.textResolve": "Resolve",
"Common.Views.ReviewPopover.textFollowMove": "Follow Move",
"Common.Views.SaveAsDlg.textLoading": "Loading",
"Common.Views.SaveAsDlg.textTitle": "Folder for save",
"Common.Views.SelectFileDlg.textLoading": "Loading",