Przeglądaj źródła

Fixes manual triggered tooltips text and no hover.

master
damencho 8 lat temu
rodzic
commit
cf69d591e4
1 zmienionych plików z 9 dodań i 5 usunięć
  1. 9
    5
      modules/UI/toolbars/Toolbar.js

+ 9
- 5
modules/UI/toolbars/Toolbar.js Wyświetl plik

@@ -362,9 +362,8 @@ Toolbar = {
362 362
             });
363 363
 
364 364
         APP.UI.addListener(UIEvents.SHOW_CUSTOM_TOOLBAR_BUTTON_POPUP,
365
-            (toolbarButtonID, popupID, show, timeout) => {
366
-                Toolbar._showCustomToolbarPopup(
367
-                    toolbarButtonID, popupID, show, timeout);
365
+            (popupID, show, timeout) => {
366
+                Toolbar._showCustomToolbarPopup(popupID, show, timeout);
368 367
             });
369 368
 
370 369
         if(!APP.tokenData.isGuest) {
@@ -741,7 +740,12 @@ Toolbar = {
741 740
             let gravity = 'n';
742 741
             if (popup.dataAttrPosition)
743 742
                 gravity = popup.dataAttrPosition;
744
-            popupElement.setAttribute('data-tooltip', gravity);
743
+            // use custom attribute to save gravity option
744
+            // we use 'data-tooltip' in UIUtil to activate all tooltips
745
+            // but we want these to be manually triggered
746
+            popupElement.setAttribute('tooltip-gravity', gravity);
747
+
748
+            APP.translation.translateElement($(popupElement));
745 749
 
746 750
             buttonElement.appendChild(popupElement);
747 751
         });
@@ -755,7 +759,7 @@ Toolbar = {
755 759
      */
756 760
     _showCustomToolbarPopup(popupSelectorID, show, timeout) {
757 761
 
758
-        const gravity = $(popupSelectorID).attr('data-tooltip');
762
+        const gravity = $(popupSelectorID).attr('tooltip-gravity');
759 763
         AJS.$(popupSelectorID)
760 764
             .tooltip({
761 765
                 trigger: 'manual',

Ładowanie…
Anuluj
Zapisz