Make link widget last selected app preference specific to each application

This commit is contained in:
Nathan Gray 2013-10-23 19:51:43 +00:00
parent 550604017e
commit 5923aed2a8

View File

@ -454,11 +454,11 @@ var et2_link_apps = et2_selectbox.extend(
// Preset to last application // Preset to last application
if(!this.options.value) if(!this.options.value)
{ {
this.set_value(egw.preference('link_app','common')); this.set_value(egw.preference('link_app',self.options.value.to_app || window.egw_appName));
} }
// Register to update preference // Register to update preference
this.input.on("click", jQuery.proxy(function() { this.input.on("click", jQuery.proxy(function() {
egw.set_preference('common','link_app',this.getValue()); egw.set_preference(self.options.value.to_app || window.egw_appName,'link_app',this.getValue());
}),this); }),this);
} }
} }
@ -560,7 +560,7 @@ var et2_link_entry = et2_inputWidget.extend(
self.cache = {}; self.cache = {};
// Update preference with new value // Update preference with new value
egw.set_preference('common','link_app',self.app_select.val()); egw.set_preference(self.options.value.to_app || window.egw_appName,'link_app',self.app_select.val());
if(typeof self.options.value != 'object') self.options.value = {}; if(typeof self.options.value != 'object') self.options.value = {};
self.options.value.app = self.app_select.val(); self.options.value.app = self.app_select.val();
@ -577,9 +577,9 @@ var et2_link_entry = et2_inputWidget.extend(
{ {
this.app_select.val(self.options.value.app); this.app_select.val(self.options.value.app);
} }
else if (egw.preference('link_app','common')) else if (egw.preference('link_app',self.options.value.to_app || window.egw_appName))
{ {
this.app_select.val(egw.preference('link_app','common')); this.app_select.val(egw.preference('link_app',self.options.value.to_app || window.egw_appName));
} }
else else
{ {