Balloon tooltips optimized
authorMarcel Werk <burntime@woltlab.com>
Fri, 12 Aug 2011 15:07:13 +0000 (17:07 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 12 Aug 2011 15:07:13 +0000 (17:07 +0200)
wcfsetup/install/files/acp/templates/packageList.tpl
wcfsetup/install/files/acp/templates/updateServerList.tpl
wcfsetup/install/files/js/WCF.js

index 475e7e515e5ed35846365f8cdc9e9114f6e24879..c304c737e98f973da12f3a7dbdcf72a85df9c004 100644 (file)
                                        <tr class="packageRow">
                                                <td class="columnIcon">
                                                        {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
-                                                               <a href="index.php?form=PackageStartInstall&amp;action=update&amp;packageID={@$package->packageID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/packageUpdateS.png" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" /></a>
+                                                               <a href="index.php?form=PackageStartInstall&amp;action=update&amp;packageID={@$package->packageID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/packageUpdateS.png" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
                                                        {else}
                                                                <img src="{@RELATIVE_WCF_DIR}icon/packageUpdateDisabledS.png" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
                                                        {/if}
                                                        {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/deleteS.png" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton" data-objectID="{@$package->packageID}" data-confirmMessage="Are you sure?" />
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/deleteS.png" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton balloonTooltip" data-objectID="{@$package->packageID}" data-confirmMessage="Are you sure?" />
                                                        {else}
                                                                <img src="{@RELATIVE_WCF_DIR}icon/deleteDisabledS.png" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" />
                                                        {/if}
index ad578282bac2215a86e5ae9b6bba987e5aa5ea32..3925f10b13a356d13050e08104163039cc082f38 100644 (file)
@@ -54,9 +54,9 @@
                                {foreach from=$updateServers item=updateServer}
                                        <tr class="updateServerRow">
                                                <td class="columnIcon">
-                                                       <img src="{@RELATIVE_WCF_DIR}icon/{if !$updateServer->disabled}enabled{else}disabled{/if}S.png" alt="" title="{lang}wcf.acp.updateServer.{if !$updateServer->disabled}disable{else}enable{/if}{/lang}" data-objectID="{@$updateServer->packageUpdateServerID}" data-disableMessage="{lang}wcf.acp.updateServer.disable{/lang}" data-enableMessage="{lang}wcf.acp.updateServer.enable{/lang}" class="toggleButton" />
-                                                       <a href="index.php?form=UpdateServerEdit&amp;packageUpdateServerID={@$updateServer->packageUpdateServerID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/editS.png" alt="" title="{lang}wcf.acp.updateServer.edit{/lang}" /></a>
-                                                       <img src="{@RELATIVE_WCF_DIR}icon/deleteS.png" alt="" title="{lang}wcf.acp.updateServer.delete{/lang}" data-objectID="{@$updateServer->packageUpdateServerID}" data-confirmMessage="{lang}wcf.acp.updateServer.delete.sure{/lang}" class="deleteButton" />
+                                                       <img src="{@RELATIVE_WCF_DIR}icon/{if !$updateServer->disabled}enabled{else}disabled{/if}S.png" alt="" title="{lang}wcf.acp.updateServer.{if !$updateServer->disabled}disable{else}enable{/if}{/lang}" data-objectID="{@$updateServer->packageUpdateServerID}" data-disableMessage="{lang}wcf.acp.updateServer.disable{/lang}" data-enableMessage="{lang}wcf.acp.updateServer.enable{/lang}" class="toggleButton balloonTooltip" />
+                                                       <a href="index.php?form=UpdateServerEdit&amp;packageUpdateServerID={@$updateServer->packageUpdateServerID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/editS.png" alt="" title="{lang}wcf.acp.updateServer.edit{/lang}" class="balloonTooltip" /></a>
+                                                       <img src="{@RELATIVE_WCF_DIR}icon/deleteS.png" alt="" title="{lang}wcf.acp.updateServer.delete{/lang}" data-objectID="{@$updateServer->packageUpdateServerID}" data-confirmMessage="{lang}wcf.acp.updateServer.delete.sure{/lang}" class="deleteButton balloonTooltip" />
                                                        
                                                        {if $additionalButtons[$updateServer->packageUpdateServerID]|isset}{@$additionalButtons[$updateServer->packageUpdateServerID]}{/if}
                                                </td>
index 867d3ddd58b159e3118c1a43fdace399f68d1b8a..fb341ca6bcc5b5a0f455b32b0889f22388519f3c 100644 (file)
@@ -1621,10 +1621,20 @@ WCF.Effect.BalloonTooltip.prototype = {
         * Moves tooltip to cursor position.
         */
        _mouseMoveHandler: function(event) {
-               this.tooltip.css({
-                       top: (event.pageY - 0) + "px",
-                       left: (event.pageX + 15) + "px"
-               });
+               if ($(document).width() - event.pageX < this.tooltip.getDimensions().width) {
+                       this.tooltip.css({
+                               top: (event.pageY) + "px",
+                               right: ($(document).width() - event.pageX) + "px",
+                               left: "auto"
+                       });
+               }
+               else {
+                       this.tooltip.css({
+                               top: (event.pageY) + "px",
+                               left: (event.pageX + 15) + "px",
+                               right: "auto"
+                       });
+               }
        }
 };