[BUGFIX] Do not trigger tooltip automatically after hide/unhide 79/58479/2
authorNikita Hovratov <nikita.h@live.de>
Sat, 29 Sep 2018 22:47:02 +0000 (00:47 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Sun, 30 Sep 2018 20:50:05 +0000 (22:50 +0200)
The tooltip is not shown now, when you move the cursor away, while the
spinning icon is active. The new label still updates, if you keep the
cursor the whole time on the button.

Resolves: #85319
Releases: master, 8.7
Change-Id: Id653a9f6d43c1ca1f6a24112edde18b50286843f
Reviewed-on: https://review.typo3.org/58479
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Resources/Private/TypeScript/AjaxDataHandler.ts
typo3/sysext/backend/Resources/Public/JavaScript/AjaxDataHandler.js

index 3c0d064..4a7cd51 100644 (file)
@@ -144,8 +144,7 @@ class AjaxDataHandler {
       // Bootstrap Tooltip internally uses only .attr('data-original-title')
       $anchorElement
         .data('toggleTitle', $anchorElement.attr('data-original-title'))
-        .attr('data-original-title', nextTitle)
-        .tooltip('show');
+        .attr('data-original-title', nextTitle);
     });
 
     const $iconElement = $anchorElement.find(Identifiers.icon);
index 526935c..044b41f 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","./Enum/Severity","jquery","./Icons","./Modal","./Notification","./Viewport"],function(e,t,n,a,i,o,r,l){"use strict";var s,d;return(d=s||(s={})).hide=".t3js-record-hide",d.delete=".t3js-record-delete",d.icon=".t3js-icon",new(function(){function e(){var e=this;a(function(){e.initialize()})}return e.refreshPageTree=function(){l.NavigationContainer&&l.NavigationContainer.PageTree&&l.NavigationContainer.PageTree.refreshTree()},e.prototype.process=function(e){var t=this;return this._call(e).done(function(e){e.hasErrors&&t.handleErrors(e)})},e.prototype.initialize=function(){var e=this;a(document).on("click",s.hide,function(t){t.preventDefault();var n=a(t.currentTarget),i=n.find(s.icon),o=n.closest("tr[data-uid]"),r=n.data("params");e._showSpinnerIcon(i),e._call(r).done(function(t){t.hasErrors?e.handleErrors(t):e.toggleRow(o)})}),a(document).on("click",s.delete,function(t){t.preventDefault();var i=a(t.currentTarget);i.tooltip("hide"),o.confirm(i.data("title"),i.data("message"),n.SeverityEnum.warning,[{text:i.data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:i.data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",function(t){"cancel"===t.target.getAttribute("name")?o.dismiss():"delete"===t.target.getAttribute("name")&&(o.dismiss(),e.deleteRecord(i))})})},e.prototype.toggleRow=function(t){var n,o,r,l=t.find(s.hide),d=l.closest("table[data-table]").data("table"),c=l.data("params");"hidden"===l.data("state")?(o="visible",n=c.replace("=0","=1"),r="actions-edit-hide"):(o="hidden",n=c.replace("=1","=0"),r="actions-edit-unhide"),l.data("state",o).data("params",n),l.tooltip("hide").one("hidden.bs.tooltip",function(){var e=l.data("toggleTitle");l.data("toggleTitle",l.attr("data-original-title")).attr("data-original-title",e).tooltip("show")});var f=l.find(s.icon);i.getIcon(r,i.sizes.small).done(function(e){f.replaceWith(e)});var u=t.find(".col-icon "+s.icon);"hidden"===o?i.getIcon("miscellaneous-placeholder",i.sizes.small,"overlay-hidden").done(function(e){u.append(a(e).find(".icon-overlay"))}):u.find(".icon-overlay").remove(),t.fadeTo("fast",.4,function(){t.fadeTo("fast",1)}),"pages"===d&&e.refreshPageTree()},e.prototype.deleteRecord=function(t){var n=this,a=t.data("params"),o=t.find(s.icon);this._showSpinnerIcon(o),this._call(a).done(function(a){if(i.getIcon("actions-edit-delete",i.sizes.small).done(function(e){(o=t.find(s.icon)).replaceWith(e)}),a.hasErrors)n.handleErrors(a);else{var r=t.closest("table[data-table]"),l=t.closest(".panel"),d=l.find(".panel-heading"),c=r.data("table"),f=t.closest("tr[data-uid]"),u=f.data("uid"),p=r.find("[data-l10nparent="+u+"]").closest("tr[data-uid]");if((f=f.add(p)).fadeTo("slow",.4,function(){f.slideUp("slow",function(){f.remove(),0===r.find("tbody tr").length&&l.slideUp("slow")})}),"0"===t.data("l10parent")||""===t.data("l10parent")){var h=Number(d.find(".t3js-table-total-items").html());d.find(".t3js-table-total-items").text(h-1)}"pages"===c&&e.refreshPageTree()}})},e.prototype.handleErrors=function(e){a.each(e.messages,function(e,t){r.error(t.title,t.message)})},e.prototype._call=function(e){return a.getJSON(TYPO3.settings.ajaxUrls.record_process,e)},e.prototype._showSpinnerIcon=function(e){i.getIcon("spinner-circle-dark",i.sizes.small).done(function(t){e.replaceWith(t)})},e}())});
\ No newline at end of file
+define(["require","exports","./Enum/Severity","jquery","./Icons","./Modal","./Notification","./Viewport"],function(e,t,n,a,i,o,r,d){"use strict";var l,s;return(s=l||(l={})).hide=".t3js-record-hide",s.delete=".t3js-record-delete",s.icon=".t3js-icon",new(function(){function e(){var e=this;a(function(){e.initialize()})}return e.refreshPageTree=function(){d.NavigationContainer&&d.NavigationContainer.PageTree&&d.NavigationContainer.PageTree.refreshTree()},e.prototype.process=function(e){var t=this;return this._call(e).done(function(e){e.hasErrors&&t.handleErrors(e)})},e.prototype.initialize=function(){var e=this;a(document).on("click",l.hide,function(t){t.preventDefault();var n=a(t.currentTarget),i=n.find(l.icon),o=n.closest("tr[data-uid]"),r=n.data("params");e._showSpinnerIcon(i),e._call(r).done(function(t){t.hasErrors?e.handleErrors(t):e.toggleRow(o)})}),a(document).on("click",l.delete,function(t){t.preventDefault();var i=a(t.currentTarget);i.tooltip("hide"),o.confirm(i.data("title"),i.data("message"),n.SeverityEnum.warning,[{text:i.data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:i.data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",function(t){"cancel"===t.target.getAttribute("name")?o.dismiss():"delete"===t.target.getAttribute("name")&&(o.dismiss(),e.deleteRecord(i))})})},e.prototype.toggleRow=function(t){var n,o,r,d=t.find(l.hide),s=d.closest("table[data-table]").data("table"),c=d.data("params");"hidden"===d.data("state")?(o="visible",n=c.replace("=0","=1"),r="actions-edit-hide"):(o="hidden",n=c.replace("=1","=0"),r="actions-edit-unhide"),d.data("state",o).data("params",n),d.tooltip("hide").one("hidden.bs.tooltip",function(){var e=d.data("toggleTitle");d.data("toggleTitle",d.attr("data-original-title")).attr("data-original-title",e)});var f=d.find(l.icon);i.getIcon(r,i.sizes.small).done(function(e){f.replaceWith(e)});var u=t.find(".col-icon "+l.icon);"hidden"===o?i.getIcon("miscellaneous-placeholder",i.sizes.small,"overlay-hidden").done(function(e){u.append(a(e).find(".icon-overlay"))}):u.find(".icon-overlay").remove(),t.fadeTo("fast",.4,function(){t.fadeTo("fast",1)}),"pages"===s&&e.refreshPageTree()},e.prototype.deleteRecord=function(t){var n=this,a=t.data("params"),o=t.find(l.icon);this._showSpinnerIcon(o),this._call(a).done(function(a){if(i.getIcon("actions-edit-delete",i.sizes.small).done(function(e){(o=t.find(l.icon)).replaceWith(e)}),a.hasErrors)n.handleErrors(a);else{var r=t.closest("table[data-table]"),d=t.closest(".panel"),s=d.find(".panel-heading"),c=r.data("table"),f=t.closest("tr[data-uid]"),u=f.data("uid"),p=r.find("[data-l10nparent="+u+"]").closest("tr[data-uid]");if((f=f.add(p)).fadeTo("slow",.4,function(){f.slideUp("slow",function(){f.remove(),0===r.find("tbody tr").length&&d.slideUp("slow")})}),"0"===t.data("l10parent")||""===t.data("l10parent")){var h=Number(s.find(".t3js-table-total-items").html());s.find(".t3js-table-total-items").text(h-1)}"pages"===c&&e.refreshPageTree()}})},e.prototype.handleErrors=function(e){a.each(e.messages,function(e,t){r.error(t.title,t.message)})},e.prototype._call=function(e){return a.getJSON(TYPO3.settings.ajaxUrls.record_process,e)},e.prototype._showSpinnerIcon=function(e){i.getIcon("spinner-circle-dark",i.sizes.small).done(function(t){e.replaceWith(t)})},e}())});
\ No newline at end of file