Commit 20f958e6 by Rocky Duan

bug fix: resize input for defaulttext (tagsinput)

parent c43d5d23
...@@ -227,6 +227,7 @@ ...@@ -227,6 +227,7 @@
markup = markup + '</div><div class="tags_clear"></div></div>'; markup = markup + '</div><div class="tags_clear"></div></div>';
$(markup).insertAfter(this); $(markup).insertAfter(this);
$(data.holder).css('width',settings.width); $(data.holder).css('width',settings.width);
$(data.holder).css('min-height',settings.height); $(data.holder).css('min-height',settings.height);
...@@ -240,6 +241,7 @@ ...@@ -240,6 +241,7 @@
$(data.fake_input).css('color',settings.placeholderColor); $(data.fake_input).css('color',settings.placeholderColor);
$(data.fake_input).resetAutosize(settings); $(data.fake_input).resetAutosize(settings);
$(data.fake_input).doAutosize(settings);
$(data.holder).bind('click',data,function(event) { $(data.holder).bind('click',data,function(event) {
$(event.data.fake_input).focus(); $(event.data.fake_input).focus();
}); });
...@@ -260,7 +262,6 @@ ...@@ -260,7 +262,6 @@
if (jQuery.Autocompleter !== undefined) { if (jQuery.Autocompleter !== undefined) {
onSelectCallback = settings.autocomplete.onItemSelect; onSelectCallback = settings.autocomplete.onItemSelect;
settings.autocomplete.onItemSelect = function() { settings.autocomplete.onItemSelect = function() {
console.log("here");
$(data.real_input).addTag($(data.fake_input).val(), {focus: true, unique: (settings.unique)}); $(data.real_input).addTag($(data.fake_input).val(), {focus: true, unique: (settings.unique)});
$(data.fake_input).resetAutosize(settings); $(data.fake_input).resetAutosize(settings);
if (onSelectCallback) { if (onSelectCallback) {
......
...@@ -439,7 +439,7 @@ Discussion = ...@@ -439,7 +439,7 @@ Discussion =
autocomplete: autocomplete:
remoteDataType: 'json' remoteDataType: 'json'
interactive: true interactive: true
defaultText: "Tag your post" defaultText: "Tag your post: press enter after each tag"
height: "30px" height: "30px"
width: "85%" width: "85%"
removeWithBackspace: true removeWithBackspace: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment