From 42468d40a707c85e84f38808bd8693e3f5d9a9d7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 5 Dec 2014 10:32:42 +0000 Subject: [PATCH] Set focus to first input when loading a template into dialog --- etemplate/js/et2_widget_dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_dialog.js b/etemplate/js/et2_widget_dialog.js index 01885d6d83..48e4e5bf9e 100644 --- a/etemplate/js/et2_widget_dialog.js +++ b/etemplate/js/et2_widget_dialog.js @@ -416,7 +416,10 @@ var et2_dialog = et2_widget.extend({ if(template.indexOf('.xet') > 0) { // File name provided, fetch from server - this.template.load("",template,this.options.value||{}); + this.template.load("",template,this.options.value||{}, jQuery.proxy(function() { + // Set focus to the first input + $j('input',this.div).first().focus(); + },this)); } else {