From: <car...@us...> - 2011-05-18 16:35:32
|
Revision: 3461 http://openutils.svn.sourceforge.net/openutils/?rev=3461&view=rev Author: carlocolombo Date: 2011-05-18 16:35:25 +0000 (Wed, 18 May 2011) Log Message: ----------- appended edit icon to container span to avoid misalignment between icon and text in case of dom insertion after domready Modified Paths: -------------- trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag Modified: trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag =================================================================== --- trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag 2011-05-16 15:50:01 UTC (rev 3460) +++ trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag 2011-05-18 16:35:25 UTC (rev 3461) @@ -35,12 +35,8 @@ var editLink = $('<a href="#" title="edit" \ style="position:absolute;background:#000 url(${appCtx}/.resources/messages/icons/edit.png) center \ center no-repeat;border-radius:4px;-moz-border-radius:4px;\ - -webkit-border-radius:4px;width:24px;height:24px;z-index:1000"></a>'); - editLink.css({ - top: container.offset().top + (container.height() - 24) / 2, - left: container.offset().left - 24 + parseInt(container.css('margin-left')) + parseInt(container.css('padding-left')) - }); - $("body").append(editLink); + -webkit-border-radius:4px;width:24px;height:24px;z-index:1000; top:-5px; left:-24px;"></a>'); + container.append(editLink).css('position','relative'); editLink.fadeTo('slow',0.3); editLink.mouseenter(function(){ editLink.fadeTo('slow',1.0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2011-05-24 07:17:04
|
Revision: 3493 http://openutils.svn.sourceforge.net/openutils/?rev=3493&view=rev Author: carlocolombo Date: 2011-05-24 07:16:57 +0000 (Tue, 24 May 2011) Log Message: ----------- fix on editing messages Modified Paths: -------------- trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag Modified: trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag =================================================================== --- trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag 2011-05-22 18:53:40 UTC (rev 3492) +++ trunk/openutils-mgnlmessages/src/main/resources/META-INF/tags/msg/msgs-global.tag 2011-05-24 07:16:57 UTC (rev 3493) @@ -19,6 +19,10 @@ <![CDATA[ (function($) { var currentMsgEdit = null; + var editLink = $('<a href="#" title="edit" \ + style="position:absolute;background:#000 url(${appCtx}/.resources/messages/icons/edit.png) center \ + center no-repeat;border-radius:4px;-moz-border-radius:4px;\ + -webkit-border-radius:4px;width:24px;height:24px;z-index:1000; top:-5px; left:-24px;"></a>'); function init(container, dialog) { container.css({ @@ -32,23 +36,17 @@ var msgDefaultLocale = container.attr("data-msgdefaultlocale"); var defaultMsg = container.attr("data-msgdefault"); - var editLink = $('<a href="#" title="edit" \ - style="position:absolute;background:#000 url(${appCtx}/.resources/messages/icons/edit.png) center \ - center no-repeat;border-radius:4px;-moz-border-radius:4px;\ - -webkit-border-radius:4px;width:24px;height:24px;z-index:1000; top:-5px; left:-24px;"></a>'); - container.append(editLink).css('position','relative'); - editLink.fadeTo('slow',0.3); - editLink.mouseenter(function(){ - editLink.fadeTo('slow',1.0); - msgsWithSameKey.animate({ - "background-color" : 'yellow'}); - }); - editLink.mouseleave(function(){ + container.append(editLink.clone()).css('position','relative').find('a') + .fadeTo('slow',0.3) + .live('mouseenter',function(){ + $(this).fadeTo('slow',1.0); + msgsWithSameKey.animate({"background-color" : 'yellow'}); + }) + .live('mouseleave',function(){ editLink.fadeTo('slow',0.3); - msgsWithSameKey.css({ - "background-color" : 'transparent'}); - }); - editLink.click(function(evt){ + msgsWithSameKey.css({"background-color" : 'transparent'}); + }) + .live('click',function(evt){ evt.preventDefault(); currentMsgEdit = container; $("#dialog-msgEdit-default").css({ @@ -73,7 +71,7 @@ var msgKey = currentMsgEdit.attr('data-msgkey'); if (valueTxt != currentMsgEdit.text().trim()) { - $("." + msgKey.replace(/\./g, '_')).text(valueTxt); + $("." + msgKey.replace(/\./g, '_')).text(valueTxt).append(editLink.clone()).find('a').fadeTo('slow',0.3); $.ajax({ url: '${appCtx}/messages/save', type: 'POST', @@ -96,7 +94,7 @@ } }, open: function() { - $("#dialog-msgEdit-value").val(currentMsgEdit.html().trim()); + $("#dialog-msgEdit-value").val(currentMsgEdit.text().trim()); }, close: function() { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |