Commits

Sebastian Sdorra committed dafa0d0

fix some ie callback errors

  • Participants
  • Parent commits df2d77f
  • Branches issue-236

Comments (0)

Files changed (3)

File scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.formpanel.js

   execCallback: function(obj, item){
     if ( Ext.isFunction( obj ) ){
       obj(item);
-    } else if ( Ext.isObject( obj )){
+    } else if ( Ext.isObject( obj ) && Ext.isFunction(obj.fn) ){
       obj.fn.call( obj.scope, item );
+    } else if (debug){
+      console.debug('obj ' + obj + ' is not valid callback object');
     }
   },
 

File scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js

     if ( debug ){
       console.debug('reload store');
     }
-    this.store.load({
-      callback: callback,
-      scope: scope
-    });
+    
+    if ( Ext.isFunction(callback) ){
+      this.store.load({
+        callback: callback,
+        scope: scope
+      });
+    } else {
+      if (debug){
+        console.debug( 'callback is not a function' );
+      }
+      this.store.load();
+    }
   },
 
   selectionChanged: function(sm){

File scm-webapp/src/main/webapp/resources/js/util/sonia.util.js

 if (!Array.prototype.filter) {
   
   Array.prototype.filter = function(fn, scope){
-    var results = [],
-    i = 0,
-    ln = array.length;
-
-    for (; i < ln; i++) {
-      if (fn.call(scope, array[i], i, array)) {
-        results.push(array[i]);
+    var results = [];
+    for (var i=0; i < this.length; i++) {
+      if (fn.call(scope, this[i], i, this)) {
+        results.push(this[i]);
       }
     }
-
     return results;
-
   }
   
 }