mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Work around existing Element and Event objects in Prototype
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1543 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -25,11 +25,15 @@ var Class = {
|
||||
|
||||
var Abstract = new Object();
|
||||
|
||||
Object.prototype.extend = function(object) {
|
||||
for (property in object) {
|
||||
this[property] = object[property];
|
||||
Object.extend = function(destination, source) {
|
||||
for (property in source) {
|
||||
destination[property] = source[property];
|
||||
}
|
||||
return this;
|
||||
return destination;
|
||||
}
|
||||
|
||||
Object.prototype.extend = function() {
|
||||
return Object.extend.apply(this, arguments);
|
||||
}
|
||||
|
||||
Function.prototype.bind = function(object) {
|
||||
@@ -294,7 +298,7 @@ if (!window.Element) {
|
||||
var Element = new Object();
|
||||
}
|
||||
|
||||
Element.extend({
|
||||
Object.extend(Element, {
|
||||
toggle: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
@@ -733,11 +737,11 @@ Form.EventObserver.prototype = (new Abstract.EventObserver()).extend({
|
||||
});
|
||||
|
||||
|
||||
//if (!window.Event) {
|
||||
if (!window.Event) {
|
||||
var Event = new Object();
|
||||
//}
|
||||
}
|
||||
|
||||
Event.extend({
|
||||
Object.extend(Event, {
|
||||
KEY_BACKSPACE: 8,
|
||||
KEY_TAB: 9,
|
||||
KEY_RETURN: 13,
|
||||
|
||||
Reference in New Issue
Block a user