From c57c817a34fd304ee7efce3dcf8455f20f83b678 Mon Sep 17 00:00:00 2001 From: "Mark M. Florida" <markflorida@wustl.edu> Date: Wed, 3 Aug 2016 12:38:35 -0500 Subject: [PATCH] XNAT-4400: Panel element descriptions weren't spawned properly; form panels (panel.form) elements can be extended with the 'element' property (like other elements). --- src/main/webapp/scripts/xnat/ui/panel.js | 4 ++-- src/main/webapp/scripts/xnat/ui/templates.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/scripts/xnat/ui/panel.js b/src/main/webapp/scripts/xnat/ui/panel.js index 74d8ba1b..5ab08dfc 100644 --- a/src/main/webapp/scripts/xnat/ui/panel.js +++ b/src/main/webapp/scripts/xnat/ui/panel.js @@ -144,14 +144,14 @@ var XNAT = getObject(XNAT || {}); ], // TODO: use opts.element for the panel itself - _formPanel = spawn('form.xnat-form-panel.panel.panel-default', { + _formPanel = spawn('form.xnat-form-panel.panel.panel-default', extend(true, { id: toDashed(opts.id || opts.element.id || opts.name) + '-panel', name: opts.name, method: opts.method || 'POST', action: opts.action ? XNAT.url.rootUrl(opts.action) : '#!', addClass: opts.classes || '', data: opts.data - }, [ + }, opts.element), [ (hideHeader ? ['div.hidden'] : ['div.panel-heading', [ ['h3.panel-title', opts.title] diff --git a/src/main/webapp/scripts/xnat/ui/templates.js b/src/main/webapp/scripts/xnat/ui/templates.js index 831c9fa6..6cb46e87 100644 --- a/src/main/webapp/scripts/xnat/ui/templates.js +++ b/src/main/webapp/scripts/xnat/ui/templates.js @@ -149,7 +149,7 @@ var XNAT = getObject(XNAT); (opts.afterElement ? opts.afterElement : []), - ['div.description', opts.description||''] + spawn('div.description', opts.description||'') )] ]); @@ -288,7 +288,7 @@ var XNAT = getObject(XNAT); } // add the description after the input - inner.push(['div.description', opts.description||opts.body||opts.html]); + inner.push(spawn('div.description', opts.description||opts.body||opts.html)); return template.panelElement(opts, [ ['label.element-label|for='+element.id||opts.id, opts.label], -- GitLab