in input elements, disable showing the autocomplete menu on focus

This commit is contained in:
rlx 2011-11-11 11:48:52 +00:00
parent b0065e1ec8
commit 571e3a3512
3 changed files with 22 additions and 14 deletions

View file

@ -75,8 +75,8 @@ Ox.Filter = function(options, self) {
{id: '!=,', title: 'is not between'}
],
list: [
{id: '=', title: 'is'},
{id: '!=', title: 'is not'}
{id: '==', title: 'is'},
{id: '!==', title: 'is not'}
],
number: [
{id: '=', title: 'is'},
@ -120,7 +120,7 @@ Ox.Filter = function(options, self) {
float: 0,
hue: 0,
integer: 0,
list: 0,
list: '',
string: '',
text: '',
time: '00:00:00',
@ -599,8 +599,10 @@ Ox.Filter = function(options, self) {
]
})
).bindEvent({
change: function(data) {
Ox.Log('FILTER', 'change event', data)
change: change,
submit: change
});
function change(data) {
var $element = data._element.parent();
changeConditionValue(
$element.data('position'),
@ -608,7 +610,6 @@ Ox.Filter = function(options, self) {
data.value
);
}
});
}
function renderConditions() {
@ -705,6 +706,7 @@ Ox.Filter = function(options, self) {
$input = Ox.Input({
autocomplete: findKey.values,
autocompleteSelect: true,
autocompleteSelectSubmit: true,
value: value,
width: 288
});

View file

@ -45,6 +45,9 @@ Ox.FormElementGroup = function(options, self) {
change: function(data) {
that.triggerEvent({change: {value: that.value()}});
},
submit: function(data) {
that.triggerEvent({change: {value: that.value()}});
},
validate: function(data) {
that.triggerEvent({validate: data});
}

View file

@ -300,7 +300,7 @@ Ox.Input = function(options, self) {
oldValue = Ox.isUndefined(oldValue) ? self.options.value : oldValue;
oldCursor = Ox.isUndefined(oldCursor) ? cursor() : oldCursor;
Ox.Log('Form', 'autocomplete', oldValue, oldCursor)
Ox.Log('AUTO', 'autocomplete', oldValue, oldCursor)
if (self.options.value || self.options.autocompleteReplaceCorrect) {
if (Ox.isFunction(self.options.autocomplete)) {
@ -404,6 +404,7 @@ Ox.Input = function(options, self) {
});
self.selectEventBound = true;
}
Ox.Log('AUTO', 'show menu')
self.$autocompleteMenu.options({
selected: selected
}).showMenu();
@ -692,7 +693,8 @@ Ox.Input = function(options, self) {
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function
Ox.UI.$document.keydown(keydown);
//Ox.UI.$document.keypress(keypress);
self.options.autocompleteSelect && setTimeout(autocomplete, 0); // fixme: why is the timeout needed?
// temporarily disabled autocomplete on focus
//self.options.autocompleteSelect && setTimeout(autocomplete, 0); // fixme: why is the timeout needed?
}
that.triggerEvent('focus');
}
@ -725,6 +727,7 @@ Ox.Input = function(options, self) {
}
if (value != self.options.value) {
self.options.value = value;
Ox.Log('AUTO', 'call autocomplete from keydown')
self.options.autocomplete && autocomplete(oldValue, oldCursor);
self.options.autovalidate && autovalidate(oldValue, oldCursor);
self.options.changeOnKeypress && that.triggerEvent({