summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/base/prado.js
blob: b1e876342430149255b025a7624d19fc09109606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Prado = Class.create();

Prado.version = '3.0a';

Prado.DefaultButton = Class.create();

Prado.DefaultButton.buttonFired = false;
Prado.DefaultButton.fire = function(event, target)
{
	if (!Prado.DefaultButton.buttonFired && event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea")))
	{
		var defaultButton = document.getElementById ? document.getElementById(target) : document.all[target];
		if (defaultButton && typeof(defaultButton.click) != "undefined")
		{
			Prado.DefaultButton.buttonFired = true;
			defaultButton.click();
			event.cancelBubble = true;
			if (event.stopPropagation)
				event.stopPropagation();
			return false;
		}
	}
	return true;
}