[BUGFIX] EXT:form - HIDDEN element cannot be accessed in form wizard 15/44415/2
authorBjörn Jacob <bjoern.jacob@tritum.de>
Fri, 30 Oct 2015 16:10:17 +0000 (17:10 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 31 Oct 2015 14:07:10 +0000 (15:07 +0100)
After creating a HIDDEN element with the help of the form wizard one is
not able to edit the element afterwards. This is due to the fact that
the element is hidden which is kind of correct but does not help the
editor to work target orientied.

This patch adds a dummy element to the HIDDEN element. The dummy
element contains the element's name and has a dotted border.
That way the editor can edit and move a HIDDEN element.

Resolves: #70637
Releases: master, 6.2
Change-Id: I933df4f7a4b01d9246f6bd0981179497c103882b
Reviewed-on: https://review.typo3.org/44415
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/form/Resources/Public/CSS/Wizard/Wizard.css
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Basic/Hidden.js

index 8c78c77..03db924 100644 (file)
@@ -295,7 +295,7 @@ li.formwizard-element div.buttongroup span.x-btn-over {
 }
 
 li.formwizard-element.hover,
-li.formwizard-element.hidden.hover{
+li.formwizard-element.hidden.hover {
        border: 1px solid #C5DBE6;
        background-color: #F9FCFF;
 }
@@ -312,6 +312,16 @@ li.formwizard-element.hidden {
        min-height: 1em;
 }
 
+li.formwizard-element.hidden-element {
+       cursor: default;
+}
+
+li.formwizard-element .hidden-dummy-element {
+       margin: 0;
+       padding: 5px;
+       border:1px dotted #A9A9A9;
+}
+
 li.formwizard-element.form {
        padding: 0;
 }
index aa9df22..abd6067 100644 (file)
@@ -11,7 +11,7 @@ TYPO3.Form.Wizard.Elements.Basic.Hidden = Ext.extend(TYPO3.Form.Wizard.Elements,
         * @cfg {String} elementClass
         * An extra CSS class that will be added to this component's Element
         */
-       elementClass: 'hidden',
+       elementClass: 'hidden-element',
 
        /**
         * @cfg {Mixed} tpl
@@ -21,13 +21,23 @@ TYPO3.Form.Wizard.Elements.Basic.Hidden = Ext.extend(TYPO3.Form.Wizard.Elements,
         */
        tpl: new Ext.XTemplate(
                '<div class="overflow-hidden">',
+                       '<p class="hidden-dummy-element">{[this.getAttributes(values.attributes, \'name\')]}</p>',
                        '<input {[this.getAttributes(values.attributes)]} />',
                '</div>',
                {
                        compiled: true,
-                       getAttributes: function(attributes) {
+                       getAttributes: function(attributes, filterBy) {
                                var attributesHtml = '';
                                Ext.iterate(attributes, function(key, value) {
+                                       if (typeof filterBy != 'undefined') {
+                                               if (key == filterBy) {
+                                                       attributesHtml = value;
+                                                       return;
+                                               } else {
+                                                       return;
+                                               }
+                                       }
+
                                        if (value) {
                                                attributesHtml += key + '="' + value + '" ';
                                        }