summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-02-08 17:07:04 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-02-08 17:07:04 +0100
commit37a643e4050bd0bb1585d38e4409a38c46c9c49b (patch)
tree8ce59472b15c19d6564b5aea81958c2a3664e82c /framework/Web/Javascripts
parent3f2c07cf735698a35093e70b35be2981f9843e8c (diff)
Javascript fixes + workaround for old internet explorer < 9
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/ajax3.js8
-rw-r--r--framework/Web/Javascripts/source/prado/controls/controls.js2
-rw-r--r--framework/Web/Javascripts/source/prado/prado.js40
3 files changed, 41 insertions, 9 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
index 98802b0a..649cb200 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
@@ -137,7 +137,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
context: this,
success: this.successHandler,
error: this.errorHandler,
- complete: this.completeHandler,
+ complete: this.completeHandler
};
jQuery.extend(this.options, options || {});
@@ -990,7 +990,7 @@ if (typeof(Prado.AssetManagerClass)=="undefined") {
isAssetLoaded: function(url) {
url = this.makeFullUrl(url);
- return (this.loadedAssets.indexOf(url)!=-1);
+ return (jQuery.inArray(url, this.loadedAssets)!=-1);
},
/**
@@ -999,7 +999,7 @@ if (typeof(Prado.AssetManagerClass)=="undefined") {
*/
markAssetAsLoaded: function(url) {
url = this.makeFullUrl(url);
- if (this.loadedAssets.indexOf(url)==-1)
+ if (jQuery.inArray(url, this.loadedAssets)==-1)
this.loadedAssets.push(url);
},
@@ -1057,7 +1057,7 @@ if (typeof(Prado.AssetManagerClass)=="undefined") {
*/
ensureAssetIsLoaded: function(url, callback) {
url = this.makeFullUrl(url);
- if (this.loadedAssets.indexOf(url)==-1)
+ if (jQuery.inArray(url, this.loadedAssets)==-1)
{
this.startAssetLoad(url,callback);
return false;
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js
index 00a39e66..3ff089c3 100644
--- a/framework/Web/Javascripts/source/prado/controls/controls.js
+++ b/framework/Web/Javascripts/source/prado/controls/controls.js
@@ -412,7 +412,7 @@ Prado.WebUI.TListControl = jQuery.klass(Prado.WebUI.PostBackControl,
doPostback : function(options, event)
{
new Prado.PostBack(options, event);
- },
+ }
});
Prado.WebUI.TListBox = jQuery.klass(Prado.WebUI.TListControl);
diff --git a/framework/Web/Javascripts/source/prado/prado.js b/framework/Web/Javascripts/source/prado/prado.js
index f0eb256f..ec7f68fc 100644
--- a/framework/Web/Javascripts/source/prado/prado.js
+++ b/framework/Web/Javascripts/source/prado/prado.js
@@ -1,4 +1,35 @@
/*
+ * Polyfill for ECMAScript5's bind() function.
+ * ----------
+ * Adds compatible .bind() function; needed for Internet Explorer < 9
+ * Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
+ */
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function (oThis) {
+ if (typeof this !== "function") {
+ // closest thing possible to the ECMAScript 5 internal IsCallable function
+ throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
+ }
+
+ var aArgs = Array.prototype.slice.call(arguments, 1),
+ fToBind = this,
+ fNOP = function () {},
+ fBound = function () {
+ return fToBind.apply(this instanceof fNOP && oThis
+ ? this
+ : oThis,
+ aArgs.concat(Array.prototype.slice.call(arguments)));
+ };
+
+ fNOP.prototype = this.prototype;
+ fBound.prototype = new fNOP();
+
+ return fBound;
+ };
+}
+
+/*
* Low Pro JQ
* ----------
*
@@ -246,14 +277,14 @@ var Prado =
* Registry for Prado components
* @var Registry
*/
- Registry: {},
+ Registry: {}
};
Prado.RequestManager =
{
FIELD_POSTBACK_TARGET : 'PRADO_POSTBACK_TARGET',
- FIELD_POSTBACK_PARAMETER : 'PRADO_POSTBACK_PARAMETER',
+ FIELD_POSTBACK_PARAMETER : 'PRADO_POSTBACK_PARAMETER'
};
/**
* Performs a PostBack using javascript.
@@ -276,6 +307,7 @@ Prado.PostBack = jQuery.klass(
initialize: function(options, event)
{
jQuery.extend(this.options, options || {});
+ this.event = event;
this.doPostBack();
},
@@ -290,7 +322,7 @@ Prado.PostBack = jQuery.klass(
if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined")
{
if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], jQuery("#" + this.options['ID'])))
- return event.preventDefault();
+ return this.event.preventDefault();
}
if(this.options['PostBackUrl'] && this.options['PostBackUrl'].length > 0)
@@ -552,7 +584,7 @@ Prado.Element =
debugger;
throw e;
}
- },
+ }
};
/**