From 61f019d0916335323e09f969c88efd684735205b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 17 Mar 2018 23:51:18 +0100 Subject: [PATCH] Avoid superfluous options when inline editing a poll --- wcfsetup/install/files/js/WCF.Poll.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Poll.js b/wcfsetup/install/files/js/WCF.Poll.js index 69b49bf665..b37d25dbcc 100644 --- a/wcfsetup/install/files/js/WCF.Poll.js +++ b/wcfsetup/install/files/js/WCF.Poll.js @@ -94,8 +94,10 @@ WCF.Poll.Management = Class.extend({ this._createOption($option.optionValue, $option.optionID); } - // add empty option - this._createOption(); + // add an empty option, unless it would exceed the limit + if (optionList.length < this._maxOptions) { + this._createOption(); + } }, /** -- 2.20.1