Fixed poll management in non inline form
authorAlexander Ebert <ebert@woltlab.com>
Sun, 5 Jun 2016 11:02:06 +0000 (13:02 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 5 Jun 2016 11:02:06 +0000 (13:02 +0200)
wcfsetup/install/files/js/WCF.Poll.js

index eed02fde8fbbc0a4e8cecc0027e47496c746ef4b..f812ea81a2da4af85efac586286c95e165a1731e 100644 (file)
@@ -68,7 +68,7 @@ WCF.Poll.Management = Class.extend({
                        WCF.System.Event.addListener('com.woltlab.wcf.redactor2', 'submit_' + editorId, this._submit.bind(this));
                }
                else {
-                       this._container.parents('form').submit($.proxy(this._submit, this));
+                       this._container.closest('form').submit($.proxy(this._submit, this));
                }
                
                // init sorting
@@ -205,7 +205,7 @@ WCF.Poll.Management = Class.extend({
                        }
                });
                
-               if (event instanceof Event) {
+               if (typeof event.originalEvent === 'object' && event.originalEvent instanceof Event) {
                        // create hidden input fields
                        if ($options.length) {
                                var $formSubmit = this._container.parents('form').find('.formSubmit');