This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git


The following commit(s) were added to refs/heads/master by this push:
     new a602a39  Fixed SLING-8004 by making the container a fieldset, removing 
the border and then adding styles to mark contained fields as disabled
a602a39 is described below

commit a602a3981d999d482c32199e737b625f678d83fe
Author: Dan Klco <[email protected]>
AuthorDate: Wed Oct 10 14:05:57 2018 -0400

    Fixed SLING-8004 by making the container a fieldset, removing the border
    and then adding styles to mark contained fields as disabled
---
 ui/src/main/frontend/src/js/cms.form.js            | 10 +--
 ui/src/main/frontend/src/js/cms.js                 |  2 +-
 ui/src/main/frontend/src/scss/cms.scss             | 81 +++++++++++++---------
 .../sling-cms/components/cms/getform/getform.jsp   |  4 +-
 .../components/editor/slingform/slingform.jsp      |  4 +-
 5 files changed, 58 insertions(+), 43 deletions(-)

diff --git a/ui/src/main/frontend/src/js/cms.form.js 
b/ui/src/main/frontend/src/js/cms.form.js
index b840041..c81a961 100644
--- a/ui/src/main/frontend/src/js/cms.form.js
+++ b/ui/src/main/frontend/src/js/cms.form.js
@@ -43,7 +43,7 @@ nomnom.decorate(".Form-Ajax", class {
         }
         var callback = $form.data('callback');
         var data = new FormData(this);
-        $form.find('.Form-Ajax__wrapper').attr('disabled', 'disabled');
+        $form.find('.form-wrapper').attr('disabled', 'disabled');
         $.ajax({
             url: $form.attr('action'),
             type: 'POST',
@@ -61,11 +61,11 @@ nomnom.decorate(".Form-Ajax", class {
             error: function(xhr, msg, err){
                 if(window.self !== window.top){
                     window.top.Sling.CMS.ui.confirmMessage(msg, err,function(){
-                        
$form.find('.Form-Ajax__wrapper').removeAttr('disabled');
+                        $form.find('.form-wrapper').removeAttr('disabled');
                     });
                 } else {
                     Sling.CMS.ui.confirmMessage(msg, err,function(){
-                        
$form.find('.Form-Ajax__wrapper').removeAttr('disabled');
+                        $form.find('.form-wrapper').removeAttr('disabled');
                     });
                 }
             }
@@ -79,9 +79,9 @@ nomnom.decorate('.Get-Form', class {
     "submit::"(){
         var $form = $(this);
         var params = $form.serialize();
-        $form.find('.Form-Ajax__wrapper').attr('disabled', 'disabled');
+        $form.find('.form-wrapper').attr('disabled', 'disabled');
         $($form.data('target')).load($form.attr('action') + '?' + params +'  ' 
+ $form.data('load'), function(){
-            $form.find('.Form-Ajax__wrapper').removeAttr('disabled');
+            $form.find('.form-wrapper').removeAttr('disabled');
         });
         return false;
     }
diff --git a/ui/src/main/frontend/src/js/cms.js 
b/ui/src/main/frontend/src/js/cms.js
index 4d93218..c1db964 100644
--- a/ui/src/main/frontend/src/js/cms.js
+++ b/ui/src/main/frontend/src/js/cms.js
@@ -97,7 +97,7 @@ Sling.CMS = {
         decorate: function($ctx){
             $ctx.find('.Sling-CMS__page-properties').each(function(){
                 var $ctr = $(this);
-                var $wrapper = $ctr.closest('.Form-Ajax__wrapper');
+                var $wrapper = $ctr.closest('.form-wrapper');
                 $($ctr.data('source')).change(function(){
                     var config = $(this).val();
                     $ctr.load($ctr.data('path')+config, function(){
diff --git a/ui/src/main/frontend/src/scss/cms.scss 
b/ui/src/main/frontend/src/scss/cms.scss
index 4b914da..6573c90 100644
--- a/ui/src/main/frontend/src/scss/cms.scss
+++ b/ui/src/main/frontend/src/scss/cms.scss
@@ -22,78 +22,93 @@
 @import "../../node_modules/bulma/bulma.sass";
 @import "../../node_modules/datatables-bulma/css/dataTables.bulma.css";
 body.cms {
-       min-height: 100vh;
-       @media screen and (min-width: $tablet), print {
-               background: url(../img/gradient.jpg) no-repeat;
-               background-attachment: fixed;
-       }
-       @media screen and (min-width: $tablet) and (max-width: $desktop - 1px) {
-               padding-left: 2em;
-       }
+    min-height: 100vh;
+    @media screen and (min-width: $tablet), print {
+        background: url(../img/gradient.jpg) no-repeat;
+        background-attachment: fixed;
+    }
+    @media screen and (min-width: $tablet) and (max-width: $desktop - 1px) {
+        padding-left: 2em;
+    }
 }
 
 dl {
-       padding: 1em 0;
+    padding: 1em 0;
 }
 
 dd {
-       padding-left: 1em;
+    padding-left: 1em;
 }
 
 dt {
-       font-weight: bold;
+    font-weight: bold;
 }
 
 h1 {
-       font-size: 200%;
+    font-size: 200%;
 }
 
 h2 {
-       font-size: 180%;
+    font-size: 180%;
 }
 
 h3 {
-       font-size: 160%;
+    font-size: 160%;
 }
 
 h4 {
-       font-size: 140%;
+    font-size: 140%;
 }
 
 h5 {
-       font-size: 120%;
+    font-size: 120%;
 }
 
 .editor-page {
-       overflow-y: auto;
+    overflow-y: auto;
+}
+
+.form-wrapper {
+    border: none;
+}
+
+.form-wrapper[disabled] .button,
+.form-wrapper[disabled] .input,
+.form-wrapper[disabled] select,
+.form-wrapper[disabled] .textarea {
+    background-color: #f5f5f5;
+    border-color: #f5f5f5;
+    box-shadow: none;
+    color: #7a7a7a;
+    cursor: not-allowed;
 }
 
 .is-draggable {
-       position: relative;
+    position: relative;
 }
 
 .menu-label {
-       text-transform: none;
-       font-size: 1.25em;
-       letter-spacing: normal;
+    text-transform: none;
+    font-size: 1.25em;
+    letter-spacing: normal;
 }
 
 .note-group-select-from-files {
-       display: none;
+    display: none;
 }
 
 .note-toolbar-wrapper {
-       height: auto !important;
+    height: auto !important;
 }
 
 .reference-list {
-       max-height: 200px;
-       overflow: auto;
+    max-height: 200px;
+    overflow: auto;
 }
 
 .preview {
-       max-width: 100%;
-       padding: 1em;
+    max-width: 100%;
+    padding: 1em;
 }
 
 #search-results .tile {
@@ -106,22 +121,22 @@ table.dataTable thead .sorting_asc:after,
 table.dataTable thead .sorting_desc:after,
 table.dataTable thead .sorting_asc_disabled:after,
 table.dataTable thead .sorting_desc_disabled:after {
-       font-family: 'jam-icons';
+    font-family: 'jam-icons';
 }
 
 table.dataTable thead .sorting:after {
-       content: "\e943"
+    content: "\e943"
 }
 
 table.dataTable thead .sorting_asc:after {
-       content: "\e93f"
+    content: "\e93f"
 }
 
 table.dataTable thead .sorting_desc:after {
-       content: "\e92a"
+    content: "\e92a"
 }
 
 .table tr.is-selected {
-       background-color: lighten($gray, 50%);
-       color: $grey-darker;
+    background-color: lighten($gray, 50%);
+    color: $grey-darker;
 }
\ No newline at end of file
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/getform/getform.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/getform/getform.jsp
index 2627a8b..6e2d007 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/getform/getform.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/getform/getform.jsp
@@ -27,7 +27,7 @@
        </c:otherwise>
 </c:choose>
 <form method="get" action="${action}" class="Get-Form" 
data-target="${properties.target}" data-load="${properties.load}">
-       <div class="Form-Ajax__wrapper field">
+       <fieldset class="form-wrapper field">
                <input type="hidden" name="_charset_" value="utf-8" />
                <sling:include path="fields" 
resourceType="sling-cms/components/general/container" />
                <div class="Field-Group">
@@ -35,5 +35,5 @@
                                <sling:encode value="${properties.button}" 
mode="HTML" />
                        </button>
                </div>
-       </div>
+       </fieldset>
 </form>
\ No newline at end of file
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
index 33b1924..e31c57f 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
@@ -18,7 +18,7 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
 <form method="post" 
action="${slingRequest.requestPathInfo.suffix}${properties.actionSuffix}" 
enctype="multipart/form-data" class="Form-Ajax" 
data-add-date="${properties.addDate != false}" 
data-callback="${properties.callback}">
-       <div class="Form-Ajax__wrapper field">
+       <fieldset class="form-wrapper field">
                <input type="hidden" name="_charset_" value="utf-8" />
                <sling:include path="fields" 
resourceType="sling-cms/components/general/container" />
                <div class="Field-Group">
@@ -26,5 +26,5 @@
                                <sling:encode value="${properties.button}" 
mode="HTML" />
                        </button>
                </div>
-       </div>
+       </fieldset>
 </form>
\ No newline at end of file

Reply via email to