Explorar el Código

Merge branch 'master' of https://github.com/unaio/una

AntonLV hace 3 años
padre
commit
2fb5effe6e
Se han modificado 2 ficheros con 14 adiciones y 2 borrados
  1. 13 2
      inc/js/editor.quill.js
  2. 1 0
      template/scripts/BxBasePage.php

+ 13 - 2
inc/js/editor.quill.js

@@ -456,6 +456,19 @@ function bx_editor_init(oEditor, oParams){
         });
     }
 
+    oEditor.keyboard.addBinding({
+        key: ' ',
+        handler: function(range, context) {
+            bx_editor_on_space_enter (oEditor.container.firstChild.innerHTML, oParams.selector);
+            return true;
+        }
+    });
+    
+   oEditor.container.addEventListener('keydown', function(event) {
+        if (event.key === 'Enter' || event.keyCode === 13) {
+             bx_editor_on_space_enter (oEditor.container.firstChild.innerHTML, oParams.selector);
+        }
+    });
     
     oEditor.on('editor-change', function(delta, oldDelta, source) {
         sVal = oEditor.container.firstChild.innerHTML;
@@ -490,8 +503,6 @@ function bx_editor_insert_html (sEditorId, sImgId, sHtml)
 
 function bx_editor_insert_img (sEditorId, sImgId, sImgUrl, sClasses) 
 {
-    console.log(888);
-
     if ('undefined' == typeof(sClasses))
         sClasses = '';
     

+ 1 - 0
template/scripts/BxBasePage.php

@@ -479,6 +479,7 @@ class BxBasePage extends BxDolPage
             $o = BxDolProfile::getInstance();
             $a['user'] = [
                 'id' => $o->id(),
+                'email' => $o->getAccountObject()->getEmail(),
                 'display_name' => $o->getDisplayName(),
                 'url' => bx_api_get_relative_url($o->getUrl()),
                 'avatar' => $o->getAvatar(),