Skip to content
Snippets Groups Projects
Commit 2622efeb authored by srosse's avatar srosse
Browse files

no-jira: fix javascript for inline editing

parent 7585dc3d
No related branches found
No related tags found
No related merge requests found
...@@ -222,25 +222,22 @@ public class FormJSHelper { ...@@ -222,25 +222,22 @@ public class FormJSHelper {
* yesFn emulates a click on the input field, which in turn "submits" to the inlineElement to extract the value * yesFn emulates a click on the input field, which in turn "submits" to the inlineElement to extract the value
*/ */
sb.append(FormJSHelper.getExtJSVarDeclaration(id)); sb.append(FormJSHelper.getExtJSVarDeclaration(id));
sb.append(id+".focus(1);");//defer focus,based on EXT sb.append(id).append(".focus(1);");//defer focus,based on EXT
sb.append("var o_ff_inline_yesFn = function(e){"); sb.append("var o_ff_inline_yesFn = function(e){");
sb.append(FormJSHelper.getJSFnCallFor(rootForm, id, FormEvent.ONCLICK)).append(";};"); sb.append(FormJSHelper.getJSFnCallFor(rootForm, id, FormEvent.ONCLICK)).append(";};");
sb.append("jQuery('#"+id+"').on('blur',o_ff_inline_yesFn);"); sb.append("jQuery('#").append(id).append("').on('blur',o_ff_inline_yesFn);");
/* /*
* noFn replaces the old value in the input field, and then "submits" to the inlineElement via yesFn * noFn replaces the old value in the input field, and then "submits" to the inlineElement via yesFn
*/ */
sb.append("var o_ff_inline_noFn = function(e){jQuery('#").append(id).append("').dom.value = '").append(oldHtmlValue).append("';o_ff_inline_yesFn(e);};"); sb.append("var o_ff_inline_noFn = function(e){ jQuery('#").append(id).append("').val('").append(oldHtmlValue).append("'); o_ff_inline_yesFn(e); };")
sb.append("\n"); .append("jQuery('#").append(id).append("').keydown(function(e) {")
sb.append("var nav = new Ext.KeyNav("+id+", {"); .append(" if(e.which == 27) {")
sb.append("\"esc\" : function(e){"); .append(" o_ff_inline_noFn();")
sb.append("o_ff_inline_noFn();Ext.EventManager.removeAll("+id+");"); .append(" } else if(e.which == 10 || e.which == 13) {")
sb.append("},"); .append(" o_ff_inline_yesFn();")
sb.append("\"enter\" : function(e){"); .append(" }")
sb.append("o_ff_inline_yesFn();Ext.EventManager.removeAll("+id+");"); .append("});");
sb.append("},");
sb.append("scope : this");
sb.append("});");
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment