]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Show description: pen is displayed near the description text;
authormka <mka@opencascade.com>
Wed, 6 Mar 2013 07:28:59 +0000 (07:28 +0000)
committermka <mka@opencascade.com>
Wed, 6 Mar 2013 07:28:59 +0000 (07:28 +0000)
Edit description/comments: when RTE is displayed the focus is inside the RTE.

Workspace/Siman/WebContent/jsp/commentPane.jsp
Workspace/Siman/WebContent/jsp/readDescription.jsp

index 63a063469e0d00a7f48ae7f11c5ecdce6c4f42af..b3360b4f79ec02ff23e9b7b822a2fcdcdbcba971 100644 (file)
@@ -51,8 +51,9 @@
                 trim(document.getElementById('comment_'+commentId+'_body').innerHTML);
 
         commentToEditId = commentId;
+        document.getElementById('commentToEditTitle').focus();
         redrawEditor();
-        document.onchange = redrawEditor;
+        window.onresize = redrawEditor;
     }
 
     function hideEditCommentEditor() {
                    target: '#display_comments_div'
                });
                
-            function showCommentEditor(commentTitle, commentBody) {
-                document.getElementById('commentTitle').value=commentTitle;
-                document.getElementById(currentRTE).contentDocument.body.innerHTML=commentBody;
+            function showCommentEditor() {
+                document.getElementById('commentTitle').value='';
+                document.getElementById(currentRTE).contentDocument.body.innerHTML='';
                 document.getElementById('add_comment_button_div').style.display = 'none';
                 document.getElementById('add_comment_div').style.display = 'block';
+                document.getElementById('commentTitle').focus();
             }
-
            
                // Bind the add button
-                   $("#add_comment_button").click(function() {showCommentEditor('','');});
+                   $("#add_comment_button").click(showCommentEditor);
                    
                    function hideCommentEditor() {
                  document.getElementById("add_comment_button_div").style.display = 'block';
index 85fbc203efe79cf35114d0bcbe7e13f9637afa2c..f1beace80df40dd94c7f34c737bbc002ed9fbbc9 100644 (file)
@@ -2,11 +2,6 @@
     pageEncoding="ISO-8859-1"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
 
-<div id="description_value_div">
-    <s:property value="descriptionValue" escapeHtml="false"/>
-</div>
-
-
 <s:if test="userCanModufyDescription()">
 
 <!-- Set description functionality -->
        function showDescriptionEditor() {
          document.getElementById("descriptionValue").contentDocument.body.innerHTML = 
             document.getElementById("description_value_div").innerHTML;
-         document.getElementById("display_description_div").style.display = 'none';
-         document.getElementById("description_buttons_div").style.display = 'none';
+         //document.getElementById("display_description_div").style.display = 'none';
+         document.getElementById("description_div").style.display = 'none';
          document.getElementById("description_editor_div").style.display = 'block';
+         document.getElementById("descriptionValue").focus();
        }
    
        function hideDescriptionEditor() {
-         document.getElementById("display_description_div").style.display = 'block';
-         document.getElementById("description_buttons_div").style.display = 'block';
+         //document.getElementById("display_description_div").style.display = 'block';
+         document.getElementById("description_div").style.display = 'block';
          document.getElementById("description_editor_div").style.display = 'none';
        }
            
@@ -38,9 +34,9 @@
        });
    </script>
 
-  <div id="description_buttons_div">
+  <div id="description_div">
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="attribute">
-      <tr>
+      <tr valign="top">
         <td width="20" height="20" align="center">
           <s:if test="%{descriptionValue==null}">  
             <img id="add_description_button" src="<s:url value="/skin/icon.add.png"/>"
             </s:a>
           </s:else>
         </td>
-      <td>&nbsp;</td>
+      <td>
+               <div id="description_value_div">
+                 <s:property value="descriptionValue" escapeHtml="false"/>
+               </div>
+               &nbsp;
+      </td>
     </tr> 
   </table>  
   </div>