mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 12:15:15 +00:00
Merge pull request #202 from git-marijus/master
make autocomplete better themable by adding an id
This commit is contained in:
commit
e651ca8b07
8 changed files with 36 additions and 11 deletions
|
@ -22,6 +22,7 @@ function nav(&$a) {
|
||||||
serviceUrl: '$base/acl',
|
serviceUrl: '$base/acl',
|
||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 250,
|
width: 250,
|
||||||
|
id: 'nav-search-text-ac',
|
||||||
});
|
});
|
||||||
a.setOptions({ autoSubmit: true, params: { type: 'x' }});
|
a.setOptions({ autoSubmit: true, params: { type: 'x' }});
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
this.ignoreValueChange = false;
|
this.ignoreValueChange = false;
|
||||||
this.serviceUrl = options.serviceUrl;
|
this.serviceUrl = options.serviceUrl;
|
||||||
this.isLocal = false;
|
this.isLocal = false;
|
||||||
|
this.id = options.id;
|
||||||
this.options = {
|
this.options = {
|
||||||
autoSubmit: false,
|
autoSubmit: false,
|
||||||
minChars: 1,
|
minChars: 1,
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
if (!this.options.width) { this.options.width = this.el.width(); }
|
if (!this.options.width) { this.options.width = this.el.width(); }
|
||||||
this.mainContainerId = 'AutocompleteContainter_' + uid;
|
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.container = $('#' + autocompleteElId);
|
||||||
this.fixPosition();
|
this.fixPosition();
|
||||||
|
|
|
@ -3,7 +3,8 @@ $(document).ready(function() {
|
||||||
a = $("#contacts-search").autocomplete({
|
a = $("#contacts-search").autocomplete({
|
||||||
serviceUrl: baseurl + '/acl',
|
serviceUrl: baseurl + '/acl',
|
||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 350,
|
width: 250,
|
||||||
|
id: 'contact-search-ac',
|
||||||
});
|
});
|
||||||
a.setOptions({ autoSubmit: true, params: { type: 'a' }});
|
a.setOptions({ autoSubmit: true, params: { type: 'a' }});
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,11 @@ $(document).ready(function() {
|
||||||
a = $("#recip").autocomplete({
|
a = $("#recip").autocomplete({
|
||||||
serviceUrl: baseurl + '/acl',
|
serviceUrl: baseurl + '/acl',
|
||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 350,
|
width: 250,
|
||||||
|
id: 'recip-ac',
|
||||||
onSelect: function(value,data) {
|
onSelect: function(value,data) {
|
||||||
$("#recip-complete").val(data);
|
$("#recip-complete").val(data);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ $(document).ready(function() {
|
||||||
serviceUrl: baseurl + '/search_ac',
|
serviceUrl: baseurl + '/search_ac',
|
||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 250,
|
width: 250,
|
||||||
|
id: 'search-text-ac',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,8 @@ $(document).ready(function() {
|
||||||
a = $("#poke-recip").autocomplete({
|
a = $("#poke-recip").autocomplete({
|
||||||
serviceUrl: baseurl + '/acl',
|
serviceUrl: baseurl + '/acl',
|
||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 350,
|
width: 250,
|
||||||
|
id: 'poke-recip-ac';
|
||||||
onSelect: function(value,data) {
|
onSelect: function(value,data) {
|
||||||
$("#poke-recip-complete").val(data);
|
$("#poke-recip-complete").val(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@ $(document).ready(function() {
|
||||||
a = $("#id_name").autocomplete({
|
a = $("#id_name").autocomplete({
|
||||||
serviceUrl: baseurl + '/acl',
|
serviceUrl: baseurl + '/acl',
|
||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 350,
|
width: 250,
|
||||||
|
id: 'id-name-ac',
|
||||||
onSelect: function(value,data) {
|
onSelect: function(value,data) {
|
||||||
$("#id_xchan").val(data);
|
$("#id_xchan").val(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -781,6 +781,12 @@ footer {
|
||||||
height: 120px;
|
height: 120px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#contacts-search {
|
||||||
|
font-size: 1em;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
#contacts-search-end {
|
#contacts-search-end {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
@ -2894,14 +2900,26 @@ div.jGrowl div.info {
|
||||||
width:100px;
|
width:100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#recip {
|
#nav-search-text-ac .autocomplete {
|
||||||
|
position: fixed;
|
||||||
|
top: 24px;
|
||||||
|
border: 1px solid $nav_bg_2;
|
||||||
|
border-top: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete {
|
#search-text-ac .autocomplete,
|
||||||
color: $font_colour;
|
#recip-ac .autocomplete,
|
||||||
border: 1px solid $nav_bg_1;
|
#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;
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autocomplete {
|
||||||
|
color: $font_colour;
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
Loading…
Reference in a new issue