mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-19 14:02:13 +01:00
merge with branch issue-236
This commit is contained in:
@@ -94,8 +94,10 @@ Sonia.rest.FormPanel = Ext.extend(Ext.FormPanel,{
|
||||
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');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -90,10 +90,18 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
|
||||
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){
|
||||
|
||||
@@ -169,18 +169,13 @@ Sonia.util.apply = function(obj, p){
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user