From 3007cafcaeb68d9315a2a50abbe23545c2d42181 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 15 Feb 2012 20:59:04 +0000 Subject: [PATCH] add 'select' option to editCell method of TextLists (helps fix #445) --- source/Ox.UI/js/List/Ox.TextList.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 0a0fed55..54a41fc0 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -825,7 +825,7 @@ Ox.TextList = function(options, self) { */ } - that.editCell = function(id, key) { + that.editCell = function(id, key, select) { Ox.Log('List', 'editCell', id, key) var $item = getItem(id), $cell = getCell(id, key), @@ -855,8 +855,10 @@ Ox.TextList = function(options, self) { submit: submit }) .appendTo($cell); - //.focusInput(true); - setTimeout($input.focusInput, 0); // fixme: strange + // fixme: why do we need a timeout? + setTimeout(function() { + $input.focusInput(select); + }, 0); function submit() { var value = $input.value(); $input.remove();