use boolean instead of propertyChangeCounter

This commit is contained in:
nightwing 2012-12-13 18:57:47 +04:00
commit c8be2ef60d

View file

@ -143,8 +143,9 @@ var TextInput = function(parentNode, host) {
}
}
if (useragent.isOldIE) {
var inPropertyChange = false;
var onPropertyChange = function(e){
if (propertyChangeCounter)
if (inPropertyChange)
return;
var data = text.value;
if (inCompostion || !data || data == PLACEHOLDER)
@ -154,12 +155,12 @@ var TextInput = function(parentNode, host) {
return syncProperty.schedule();
sendText(data);
propertyChangeCounter++;
// ie8 calls propertychange handlers synchronously!
inPropertyChange = true;
resetValue();
propertyChangeCounter--;
inPropertyChange = false;
};
var syncProperty = lang.delayedCall(onPropertyChange);
var propertyChangeCounter = 0;
event.addListener(text, "propertychange", onPropertyChange);
var keytable = { 13:1, 27:1 };