Fix error undefined to_app, and jquery UncaughtTypeError happens onclick handler

This commit is contained in:
Hadi Nategh 2014-06-27 13:27:18 +00:00
parent b75a9c42a2
commit 7a3d0e50da

View File

@ -455,9 +455,11 @@ var et2_link_apps = et2_selectbox.extend(
this.set_value(egw.preference('link_app', this.egw().getAppName()));
}
// Register to update preference
this.input.on("click", jQuery.proxy(function() {
egw.set_preference(this.options.value.to_app || this.egw().getAppName(),'link_app',this.getValue());
}),this);
var self = this;
this.input.bind("click",function() {
if (typeof self.options.value != 'undefined') var appname = self.options.value.to_app;
egw.set_preference(appname || self.egw().getAppName(),'link_app',self.getValue());
});
}
},