From 588d10c2dcc21a87c3d8582a8cf49855ab86aa8b Mon Sep 17 00:00:00 2001 From: Florian BLOUET Date: Fri, 26 Feb 2016 13:04:26 +0100 Subject: [PATCH] PHRAS-1016 - fix default selection to group instead of records for story editing --- resources/www/prod/js/record.editor.js | 12 +++++++++++- templates/web/prod/actions/edit_default.html.twig | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/www/prod/js/record.editor.js b/resources/www/prod/js/record.editor.js index 7a85d317df..97601d1e30 100644 --- a/resources/www/prod/js/record.editor.js +++ b/resources/www/prod/js/record.editor.js @@ -673,6 +673,11 @@ function edit_clk_editimg(evt, i) { updateEditSelectedRecords(evt); } +function toggleGroupSelection() { + var groupIndex = 0; + edit_clk_editimg(false, groupIndex); +} + // --------------------------------------------------------------------------- // on a clique sur une checkbox de status // --------------------------------------------------------------------------- @@ -1651,7 +1656,12 @@ function startThisEditing(sbas_id, what, regbasprid, ssel) { if ($('#editcontextwrap').length == 0) $('body').append('
'); - self.setTimeout("edit_select_all();", 100); + // if is a group, only select the group + if (p4.edit.what === 'GRP') { + toggleGroupSelection(); + } else { + self.setTimeout("edit_select_all();", 100); + } $('.previewTips, .DCESTips, .fieldTips', p4.edit.editBox).tooltip({ fixable: true, diff --git a/templates/web/prod/actions/edit_default.html.twig b/templates/web/prod/actions/edit_default.html.twig index c04e721fda..7c8a3a7c03 100644 --- a/templates/web/prod/actions/edit_default.html.twig +++ b/templates/web/prod/actions/edit_default.html.twig @@ -31,7 +31,7 @@ {% set class_status = '' %} {% endif %} -
+
{{ record.get_original_name() }}