From a308057bf359a4c74272d4284f7b8406dfc5793b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 31 Jul 2016 13:18:10 +0200 Subject: [PATCH] Resolve media search threshold todo --- wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js | 3 ++- wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js b/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js index b06dafb645..c51c51d816 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js @@ -28,7 +28,8 @@ define( function MediaManagerBase(options) { this._options = Core.extend({ dialogTitle: Language.get('wcf.media.manager'), - fileTypeFilters: {} + fileTypeFilters: {}, + minSearchLength: 3 }, options); this._media = new Dictionary(); diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js b/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js index d2b362d8a4..a8dd5045eb 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js @@ -80,8 +80,7 @@ define(['Ajax', 'Core', 'Dom/Traverse', 'Dom/Util', 'Language', 'WoltLab/WCF/Med var innerInfo = DomTraverse.childByClass(this._input.parentNode.parentNode, 'innerInfo'); - // TODO: threshold option? - if (this._input.value.length >= 3) { + if (this._input.value.length >= this._mediaManager.getOption('minSearchLength')) { if (innerInfo) { elHide(innerInfo); } -- 2.20.1