diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index 52cebac6f..d8bea90fc 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -98,6 +98,11 @@ define([ if (e) { var btn = $(e.target); if (btn && btn.hasClass('revision-restore')) { + var tip = item.btnTip; + if (tip) { + tip.dontShow = true; + tip.tip().remove(); + } if (record.get('isRevision')) Common.Gateway.requestRestore(record.get('revision')); else { diff --git a/apps/common/main/lib/view/History.js b/apps/common/main/lib/view/History.js index 79dee0894..7bd254459 100644 --- a/apps/common/main/lib/view/History.js +++ b/apps/common/main/lib/view/History.js @@ -96,12 +96,28 @@ define([ el: $('#history-btn-back'), enableToggle: false }); - + + var me = this; + var changetooltip = function (dataview, view, record) { + if (record.get('selected')) { + var btns = $(view.el).find('.revision-restore').tooltip({title: me.textRestore, placement: 'cursor'}); + if (btns) + view.btnTip = btns.data('bs.tooltip'); + } else if (view.btnTip) { + view.btnTip.dontShow = true; + view.btnTip.tip().remove(); + view.btnTip = null; + } + }; + this.viewHistoryList.on('item:add', changetooltip); + this.viewHistoryList.on('item:change', changetooltip); + this.trigger('render:after', this); return this; }, - textHistoryHeader: 'Back to Document' + textHistoryHeader: 'Back to Document', + textRestore: 'Restore' }, Common.Views.History || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 8e700ac9e..a21d0a674 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -142,6 +142,7 @@ "Common.Views.Header.openNewTabText": "Open in New Tab", "Common.Views.Header.textBack": "Go to Documents", "Common.Views.History.textHistoryHeader": "Back to Document", + "Common.Views.History.textRestore": "Restore", "Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel", "Common.Views.ImageFromUrlDialog.okButtonText": "OK", "Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:",