Merge pull request #202 from git-marijus/master

make autocomplete better themable by adding an id
This commit is contained in:
friendica 2013-11-14 12:09:06 -08:00
commit e651ca8b07
8 changed files with 36 additions and 11 deletions

View file

@ -22,6 +22,7 @@ function nav(&$a) {
serviceUrl: '$base/acl',
minChars: 2,
width: 250,
id: 'nav-search-text-ac',
});
a.setOptions({ autoSubmit: true, params: { type: 'x' }});

View file

@ -35,6 +35,7 @@
this.ignoreValueChange = false;
this.serviceUrl = options.serviceUrl;
this.isLocal = false;
this.id = options.id;
this.options = {
autoSubmit: false,
minChars: 1,
@ -77,7 +78,7 @@
if (!this.options.width) { this.options.width = this.el.width(); }
this.mainContainerId = 'AutocompleteContainter_' + uid;
$('<div id="' + this.mainContainerId + '" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="' + autocompleteElId + '" style="display:none; width:300px;"></div></div></div>').appendTo('body');
$('<div id="' + this.mainContainerId + '" style="position:absolute;z-index:9999;"><div class="autocomplete-w1" id="'+this.id+'"><div class="autocomplete" id="' + autocompleteElId + '" style="display:none; width:300px;"></div></div></div>').appendTo('body');
this.container = $('#' + autocompleteElId);
this.fixPosition();

View file

@ -3,7 +3,8 @@ $(document).ready(function() {
a = $("#contacts-search").autocomplete({
serviceUrl: baseurl + '/acl',
minChars: 2,
width: 350,
width: 250,
id: 'contact-search-ac',
});
a.setOptions({ autoSubmit: true, params: { type: 'a' }});

View file

@ -3,10 +3,11 @@ $(document).ready(function() {
a = $("#recip").autocomplete({
serviceUrl: baseurl + '/acl',
minChars: 2,
width: 350,
width: 250,
id: 'recip-ac',
onSelect: function(value,data) {
$("#recip-complete").val(data);
}
},
});
});

View file

@ -4,6 +4,7 @@ $(document).ready(function() {
serviceUrl: baseurl + '/search_ac',
minChars: 2,
width: 250,
id: 'search-text-ac',
});
});

View file

@ -3,7 +3,8 @@ $(document).ready(function() {
a = $("#poke-recip").autocomplete({
serviceUrl: baseurl + '/acl',
minChars: 2,
width: 350,
width: 250,
id: 'poke-recip-ac';
onSelect: function(value,data) {
$("#poke-recip-complete").val(data);
}

View file

@ -3,7 +3,8 @@ $(document).ready(function() {
a = $("#id_name").autocomplete({
serviceUrl: baseurl + '/acl',
minChars: 2,
width: 350,
width: 250,
id: 'id-name-ac',
onSelect: function(value,data) {
$("#id_xchan").val(data);
}

View file

@ -781,6 +781,12 @@ footer {
height: 120px;
padding: 10px;
}
#contacts-search {
font-size: 1em;
width: 300px;
}
#contacts-search-end {
margin-bottom: 10px;
}
@ -2894,14 +2900,26 @@ div.jGrowl div.info {
width:100px;
}
#recip {
#nav-search-text-ac .autocomplete {
position: fixed;
top: 24px;
border: 1px solid $nav_bg_2;
border-top: none;
}
.autocomplete {
color: $font_colour;
border: 1px solid $nav_bg_1;
#search-text-ac .autocomplete,
#recip-ac .autocomplete,
#poke-recip-ac .autocomplete,
#id-name-ac .autocomplete,
#contact-search-ac .autocomplete {
margin-top: 2px;
margin-left: $radiuspx;
border: 1px solid #666;
border-top: none;
}
.autocomplete {
color: $font_colour;
background: #FFF;
cursor: pointer;
text-align: left;