This commit is contained in:
2024-11-05 10:47:20 -07:00
parent c801b1ff51
commit 5315c47fcd
276 changed files with 2990 additions and 6370 deletions

View File

@@ -99,6 +99,7 @@ Sys.Extended.UI.AutoCompleteBehavior = function(element) {
this._focusHandler = null;
this._blurHandler = null;
this._bodyClickHandler = null;
this._clickHandler = null;
this._completionListBlurHandler = null;
this._keyDownHandler = null;
this._mouseDownHandler = null;
@@ -188,6 +189,7 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
this._mouseOverHandler = Function.createDelegate(this, this._onListMouseOver);
this._completionListBlurHandler = Function.createDelegate(this, this._onCompletionListBlur);
this._bodyClickHandler = Function.createDelegate(this, this._onCompletionListBlur);
this._clickHandler = Function.createDelegate(this, this._onInputClick);
this._timer = new Sys.Timer();
@@ -244,6 +246,7 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
$removeHandler(element, "focus", this._focusHandler);
$removeHandler(element, "blur", this._blurHandler);
$removeHandler(element, "keydown", this._keyDownHandler);
$removeHandler(element, "click", this._clickHandler);
$removeHandler(this._completionListElement, 'blur', this._completionListBlurHandler);
$removeHandler(this._completionListElement, 'mousedown', this._mouseDownHandler);
$removeHandler(this._completionListElement, 'mouseup', this._mouseUpHandler);
@@ -258,6 +261,7 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
this._tickHandler = null;
this._focusHandler = null;
this._blurHandler = null;
this._clickHandler = null;
this._keyDownHandler = null;
this._completionListBlurHandler = null;
this._mouseDownHandler = null;
@@ -277,6 +281,7 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
$addHandler(element, "focus", this._focusHandler);
$addHandler(element, "blur", this._blurHandler);
$addHandler(element, "keydown", this._keyDownHandler);
$addHandler(element, "click", this._clickHandler);
},
initializeCompletionList: function(element) {
@@ -307,6 +312,16 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
$addHandler(document.body, 'click', this._bodyClickHandler);
},
_onInputClick: function(e) {
if(!e)
e = window.event;
if(e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
},
_currentCompletionWord: function() {
var element = this.get_element();
var elementValue = element.value;
@@ -708,7 +723,10 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
} else {
element.value = newText;
}
$common.tryFireEvent(element, "change");
// In Chrome and Firefox, this event is triggered automatically
if ($common.isMsBrowser() || $common.isAppleBrowser())
$common.tryFireEvent(element, "change");
this.raise_itemSelected(new Sys.Extended.UI.AutoCompleteItemEventArgs(item, text, item ? item._value : null));
@@ -1281,4 +1299,4 @@ Sys.Extended.UI.AutoCompleteItemEventArgs.prototype = {
this._value = value;
}
}
Sys.Extended.UI.AutoCompleteItemEventArgs.registerClass('Sys.Extended.UI.AutoCompleteItemEventArgs', Sys.EventArgs);
Sys.Extended.UI.AutoCompleteItemEventArgs.registerClass('Sys.Extended.UI.AutoCompleteItemEventArgs', Sys.EventArgs);