This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 94d1d75  [OPENMEETINGS-1997] WB tab is renamed on 'Enter'
94d1d75 is described below

commit 94d1d7563267cd647b16922299fc96514b8f4827
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Thu Feb 7 15:54:57 2019 +0700

    [OPENMEETINGS-1997] WB tab is renamed on 'Enter'
---
 .../apache/openmeetings/web/room/wb/raw-wb-area.js | 25 ++++++++++++++--------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
index 3fd882a..70ee047 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
@@ -267,15 +267,22 @@ var DrawWbArea = function() {
                                        return;
                                }
                                const editor = $('<input name="newName" 
type="text" style="color: black;"/>')
-                                       , name = 
$(this).hide().after(editor.val(obj.name));
-                               editor.focus().blur(function() {
-                                       const newName = $(this).val();
-                                       if (newName !== '') {
-                                               wbAction('renameWb', 
JSON.stringify({wbId: obj.wbId, name: newName}));
-                                       }
-                                       $(this).remove();
-                                       name.show();
-                               });
+                                       , name = 
$(this).hide().after(editor.val(obj.name))
+                                       , renameWbTab = function() {
+                                               const newName = editor.val();
+                                               if (newName !== '') {
+                                                       wbAction('renameWb', 
JSON.stringify({wbId: obj.wbId, name: newName}));
+                                               }
+                                               editor.remove();
+                                               name.show();
+                                       };
+                               editor.focus()
+                                       .blur(renameWbTab)
+                                       .keyup(function(evt) {
+                                               if (evt.which == 13) {
+                                                       renameWbTab();
+                                               }
+                                       });
                        });
 
                tabs.find('.ui-tabs-nav').append(li);

Reply via email to