Resolve media search threshold todo
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:18:10 +0000 (13:18 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:30:58 +0000 (13:30 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js

index b06dafb645115dd11227083ffcf868404de56ba7..c51c51d816907b20754406b867d73e8f6ea2506c 100644 (file)
@@ -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();
index d2b362d8a4ed54af028d1a57d345d54aca5bdd26..a8dd5045eb864112228906f4b91dc987ab91d95d 100644 (file)
@@ -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);
                                        }