[BUGFIX] Remove tooltip over delete button when it's clicked 63/58463/3
authorNikita Hovratov <nikita.h@live.de>
Sat, 29 Sep 2018 17:11:46 +0000 (19:11 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 29 Sep 2018 20:03:44 +0000 (22:03 +0200)
The tooltip has to be removed at that point, because as soon as any data
is deleted the row disappears and it's not possible to trigger the
mouseout event manually.

Resolves: #81856
Releases: master, 8.7
Change-Id: I2f7388b6a278de9ba19e81ec20ed3ae0052b1698
Reviewed-on: https://review.typo3.org/58463
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
typo3/sysext/backend/Resources/Private/TypeScript/AjaxDataHandler.ts
typo3/sysext/backend/Resources/Public/JavaScript/AjaxDataHandler.js

index a8905b9..3c0d064 100644 (file)
@@ -89,6 +89,7 @@ class AjaxDataHandler {
     $(document).on('click', Identifiers.delete, (evt: JQueryEventObject): void => {
       evt.preventDefault();
       const $anchorElement = $(evt.currentTarget);
+      $anchorElement.tooltip('hide');
       const $modal = Modal.confirm($anchorElement.data('title'), $anchorElement.data('message'), SeverityEnum.warning, [
         {
           text: $anchorElement.data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
index 0c2b510..526935c 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,s){"use strict";var l,d;return(d=l||(l={})).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(){s.NavigationContainer&&s.NavigationContainer.PageTree&&s.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);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,s=t.find(l.hide),d=s.closest("table[data-table]").data("table"),c=s.data("params");"hidden"===s.data("state")?(o="visible",n=c.replace("=0","=1"),r="actions-edit-hide"):(o="hidden",n=c.replace("=1","=0"),r="actions-edit-unhide"),s.data("state",o).data("params",n),s.tooltip("hide").one("hidden.bs.tooltip",function(){var e=s.data("toggleTitle");s.data("toggleTitle",s.attr("data-original-title")).attr("data-original-title",e).tooltip("show")});var f=s.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"===d&&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]"),s=t.closest(".panel"),d=s.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&&s.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,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