From 7a3d0e50da0e4df93852cb4f108e76b8b6cd90e8 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 27 Jun 2014 13:27:18 +0000 Subject: [PATCH] Fix error undefined to_app, and jquery UncaughtTypeError happens onclick handler --- etemplate/js/et2_widget_link.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index cf0c033744..c2139fb423 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -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()); + }); } },