Rely on native `click()` method if possible
authorAlexander Ebert <ebert@woltlab.com>
Wed, 28 Sep 2016 15:04:43 +0000 (17:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 28 Sep 2016 15:04:43 +0000 (17:04 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js

index e0a6f94172f49a5596e4c9972607886910acf23d..6bd46e75b929666d477293efda4b18f37b101a12 100644 (file)
@@ -231,7 +231,12 @@ $.Redactor.prototype.WoltLabKeydown = function() {
                                                        if (submit) {
                                                                data.cancel = true;
                                                                
-                                                               Core.triggerEvent(submitButton, WCF_CLICK_EVENT);
+                                                               if (typeof submitButton.click === 'function') {
+                                                                       submitButton.click();
+                                                               }
+                                                               else {
+                                                                       Core.triggerEvent(submitButton, WCF_CLICK_EVENT);
+                                                               }
                                                        }
                                                }
                                        }).bind(this));