coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3802 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+18
-12
@@ -152,14 +152,20 @@ Number.prototype.limitSigDigs = function(sig) {
|
|||||||
* {Function}
|
* {Function}
|
||||||
*/
|
*/
|
||||||
Function.prototype.bind = function() {
|
Function.prototype.bind = function() {
|
||||||
var __method = this, args = [], object = arguments[0];
|
var __method = this;
|
||||||
for (var i = 1; i < arguments.length; i++)
|
var args = [];
|
||||||
args.push(arguments[i]);
|
var object = arguments[0];
|
||||||
return function(moreargs) {
|
|
||||||
for (var i = 0; i < arguments.length; i++)
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
args.push(arguments[i]);
|
args.push(arguments[i]);
|
||||||
return __method.apply(object, args);
|
}
|
||||||
}
|
|
||||||
|
return function(moreargs) {
|
||||||
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
|
args.push(arguments[i]);
|
||||||
|
}
|
||||||
|
return __method.apply(object, args);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -174,8 +180,8 @@ Function.prototype.bind = function() {
|
|||||||
* {Function}
|
* {Function}
|
||||||
*/
|
*/
|
||||||
Function.prototype.bindAsEventListener = function(object) {
|
Function.prototype.bindAsEventListener = function(object) {
|
||||||
var __method = this;
|
var __method = this;
|
||||||
return function(event) {
|
return function(event) {
|
||||||
return __method.call(object, event || window.event);
|
return __method.call(object, event || window.event);
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user