list fixes: headers, invalid elements, easier ending
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / keyboard.js
index dfe65d0..e7a3ba3 100644 (file)
@@ -375,6 +375,9 @@ var keyEventHandlers = [
                 var p = list.after({tagName: 'div', attrs: {'class': 'p'}});
                 p.append({text: ''});
                 item.detach();
                 var p = list.after({tagName: 'div', attrs: {'class': 'p'}});
                 p.append({text: ''});
                 item.detach();
+                if(list.contents().length === 0) {
+                    list.detach();
+                }
                 return p;
             }, {
                 success: function(p) {
                 return p;
             }, {
                 success: function(p) {