채수원 2015-01-07
Merge branch 'issue-1018' of dlab/hive
from pull-request 1357

* refs/heads/issue-1018:
  add "minLength" option in yobi.ui.Typeahead

Reviewed-by: 채수원 
@d668863747e76fcaec2cce4f91141edd06943cc7
public/javascripts/common/yobi.ui.Typeahead.js
--- public/javascripts/common/yobi.ui.Typeahead.js
+++ public/javascripts/common/yobi.ui.Typeahead.js
@@ -75,7 +75,7 @@
         function _initElement(sQuery){
             try {
                 htElement.welInput = $(sQuery);
-                htElement.welInput.typeahead({ minLength: 0 });
+                htElement.welInput.typeahead({ minLength: htVar.htData.minLength || 0 });
                 htData = htElement.welInput.data('typeahead');
                 htData.items = htVar.htData.limit || 8;
                 htData.source = htVar.htData.source || _onTypeAhead;
@@ -88,7 +88,7 @@
                     htData.render = htVar.htData.render;
                 }
 
-                htData.minLength = 0;
+                htData.minLength = htVar.htData.minLength || 0;
             } catch (err){
                 if(typeof console == "object") {
                     console.log(err);
public/javascripts/service/yobi.organization.Member.js
--- public/javascripts/service/yobi.organization.Member.js
+++ public/javascripts/service/yobi.organization.Member.js
@@ -45,6 +45,7 @@
 
             htVar.oTypeahead = new yobi.ui.Typeahead("#loginId", {
                 "htData" : {
+                    "minLength" : 1,
                     "updater" : _updater,
                     "source" : _source,
                     "render" : _render
public/javascripts/service/yobi.project.Member.js
--- public/javascripts/service/yobi.project.Member.js
+++ public/javascripts/service/yobi.project.Member.js
@@ -47,6 +47,7 @@
 
             htVar.oTypeahead = new yobi.ui.Typeahead("#loginId", {
                 "htData" : {
+                    "minLength" : 1,
                     "updater" : _updater,
                     "source" : _source,
                     "render" : _render
Add a comment
List