From c147837a3ee56d68710e910c2c90361480bf7113 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Mon, 8 Mar 2010 19:27:37 +0000 Subject: [PATCH] Cell and facet choice edit popups now allow Shift-Enter as a means to insert new lines. Plain Enter still applies the edit immediately. git-svn-id: http://google-refine.googlecode.com/svn/trunk@239 7d457c2a-affb-35e4-300a-418c747d4874 --- src/main/webapp/scripts/facets/list-facet.js | 10 ++++++---- .../webapp/scripts/views/data-table-cell-ui.js | 14 ++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/scripts/facets/list-facet.js b/src/main/webapp/scripts/facets/list-facet.js index 374e6c193..3381f19d2 100644 --- a/src/main/webapp/scripts/facets/list-facet.js +++ b/src/main/webapp/scripts/facets/list-facet.js @@ -309,10 +309,12 @@ ListFacet.prototype._editChoice = function(choice, choiceDiv) { elmts.textarea .text(originalContent) .keydown(function(evt) { - if (evt.keyCode == 13) { - commit(); - } else if (evt.keyCode == 27) { - MenuSystem.dismissAll(); + if (!evt.shiftKey) { + if (evt.keyCode == 13) { + commit(); + } else if (evt.keyCode == 27) { + MenuSystem.dismissAll(); + } } }) .select() diff --git a/src/main/webapp/scripts/views/data-table-cell-ui.js b/src/main/webapp/scripts/views/data-table-cell-ui.js index a23e1bbe2..ac150f57b 100644 --- a/src/main/webapp/scripts/views/data-table-cell-ui.js +++ b/src/main/webapp/scripts/views/data-table-cell-ui.js @@ -396,13 +396,15 @@ DataTableCellUI.prototype._startEdit = function(elmt) { elmts.textarea .text(originalContent) .keydown(function(evt) { - if (evt.keyCode == 13) { - if (evt.ctrlKey) { - elmts.applyOthersCheckbox[0].checked = true; + if (!evt.shiftKey) { + if (evt.keyCode == 13) { + if (evt.ctrlKey) { + elmts.applyOthersCheckbox[0].checked = true; + } + commit(); + } else if (evt.keyCode == 27) { + MenuSystem.dismissAll(); } - commit(); - } else if (evt.keyCode == 27) { - MenuSystem.dismissAll(); } }) .select()