Added support for clicking into the void after a quote
authorAlexander Ebert <ebert@woltlab.com>
Fri, 17 Oct 2014 00:12:55 +0000 (02:12 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 17 Oct 2014 00:12:55 +0000 (02:12 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 22fb89dd91a22450215254de801dbbc859c7dc36..8694994bd16ab3ce5b077ab4ccea4197b2dd6609 100644 (file)
@@ -90,6 +90,15 @@ RedactorPlugins.wbbcode = function() {
                                        this.button.get('html').children('i').removeClass('fa-square').addClass('fa-square-o');
                                }
                        }).bind(this);
+                       
+                       // insert a new line if user clicked into the editor and the last children is a quote (same behavior as arrow down)
+                       this.wutil.setOption('clickCallback', (function(event) {
+                               if (event.target === this.$editor[0]) {
+                                       if (this.$editor[0].lastElementChild && this.$editor[0].lastElementChild.tagName === 'BLOCKQUOTE') {
+                                               this.wutil.setCaretAfter($(this.$editor[0].lastElementChild));
+                                       }
+                               }
+                       }).bind(this));
                },
                
                /**