Smarteditor 2.1.6 data tooltip stops working if "Add" button is pressed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Smarteditor 2.1.6 data tooltip stops working if "Add" button is pressed

Paul
Hello,

I noticed that if data field "Add" button is pressed, data title tooltip stops working.

Steps to reproduce the situation:
1. Start with a new document, for example "dataset"


2. Click on some data title which has "Add" button, for example "Alternate title". Tooltip popup appears.


3. Click on "Add" button, new data tab appears.
4. Click again on "Alternate title". Tooltip popup does not appear any more.


How can it be fixed?

Thanks,
Paul.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Smarteditor 2.1.6 data tooltip stops working if "Add" button is pressed

Kristian Senkler
Hi Paul,

you're right, I managed to reproduce the problem. The reason for this behavior is that the tooltips are bound to the CSS class "tooltip" only once the editor is started, but not after any modification of the DOM tree. Unfortunately this happens every time you add or remove an element, so you're losing the tooltip ability after the first AJAX call that you trigger.

I fixed it on the latest trunk SNAPSHOT. All I did was to ensure that the tooltips are rebuild properly after any kind of DOM manipulation. Just update the following files in your deployment:

https://svn.52north.org/svn/metadata/smarteditor/trunk/smarteditor-webapp/src/main/webapp/WEB-INF/jsp/header.jsp
https://svn.52north.org/svn/metadata/smarteditor/trunk/smarteditor-webapp/src/main/webapp/WEB-INF/jsp/body.jsp

The first file fixes the problem by surrounding the "setupTooltips()"-function with the AJAX complete event:

$.ajaxSetup({
                complete: function () {
                    setupTooltips('${pageContext.request.locale.language}',
                            '${pageContext.request.contextPath}',
                            '<fmt:message key="editor.tooltip.header"/>');
                }
            });

In the file I simple removed unnecessary stuff.

Hope this helps,
Kristian

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Paul
Gesendet: Mittwoch, 31. Juli 2013 14:11
An: [hidden email]
Betreff: [Metadata] Smarteditor 2.1.6 data tooltip stops working if "Add" button is pressed

Hello,

I noticed that if data field "Add" button is pressed, data title tooltip stops working.

Steps to reproduce the situation:
1. Start with a new document, for example "dataset"
<http://metadata.forum.52north.org/file/n4011956/tootlip1.png>

2. Click on some data title which has "Add" button, for example "Alternate title". Tooltip popup appears.
<http://metadata.forum.52north.org/file/n4011956/tooltip2.png>

3. Click on "Add" button, new data tab appears.
4. Click again on "Alternate title". Tooltip popup does not appear any more.
<http://metadata.forum.52north.org/file/n4011956/tooltip3.png>

How can it be fixed?

Thanks,
Paul.



--
View this message in context: http://metadata.forum.52north.org/Smarteditor-2-1-6-data-tooltip-stops-working-if-Add-button-is-pressed-tp4011956.html
Sent from the 52°North - Metadata Management Community Forum mailing list archive at Nabble.com.
_______________________________________________
Metadata mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/metadata
_______________________________________________
Metadata mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/metadata
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Smarteditor 2.1.6 data tooltip stops working if "Add" button is pressed

Paul
Thanks for fix and explanation, now tooltips works correctly
Loading...