allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject [1/2] allura git commit: Make forums admin inline editing layout better and "cancel" the right things (not submit buttons, correct checkbox value)
Date Wed, 26 Sep 2018 19:11:15 GMT
Repository: allura
Updated Branches:
  refs/heads/master 7f849d9fb -> b37c80570


Make forums admin inline editing layout better and "cancel" the right things (not submit buttons,
correct checkbox value)


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/691103ca
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/691103ca
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/691103ca

Branch: refs/heads/master
Commit: 691103caad6eb07818eeb0fec993d9454f754480
Parents: 0f77ad5
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Sep 25 17:02:34 2018 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Sep 25 17:02:34 2018 -0400

----------------------------------------------------------------------
 Allura/allura/nf/allura/css/site_style.css |  7 ++++++-
 Allura/allura/public/nf/js/allura-base.js  | 20 +++++++++++++-------
 2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/691103ca/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index ffaeb7c..0fb43fe 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2854,7 +2854,7 @@ h1.title .viewer:hover {
 }
 
 .editable .editor .save_controls {
-  width: 115px;
+  width: 150px;
 }
 
 .editable .editor.multiline .save_holder {
@@ -2866,6 +2866,11 @@ h1.title .viewer:hover {
   z-index: 10;
 }
 
+.editable .editor.multiline textarea{
+    width: 95%;
+    min-width: 300px;
+}
+
 .editable .editor .save_holder .cancel_btn {
   float: left;
   margin: 5px 1em 0;

http://git-wip-us.apache.org/repos/asf/allura/blob/691103ca/Allura/allura/public/nf/js/allura-base.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/allura-base.js b/Allura/allura/public/nf/js/allura-base.js
index 040f679..e03f065 100644
--- a/Allura/allura/public/nf/js/allura-base.js
+++ b/Allura/allura/public/nf/js/allura-base.js
@@ -47,7 +47,11 @@
         .find('input, select, textarea').each(function(i){
             var $this = $(this);
             var editor = $this.closest('.editor');
-            $this.attr('original_val', this.value);
+            if ($this.attr('type') === 'checkbox') {
+                $this.attr('original_val', this.checked);
+            } else {
+                $this.attr('original_val', this.value);
+            }
             if(!$('a.cancel_btn', editor).length){
                 var save_btns = $('<div class="save_holder"><input type="submit"
value="Save"/><a href="#" class="cancel_btn">Cancel</a></div>');
                 if(editor.hasClass('multiline')){
@@ -69,12 +73,14 @@
         })
         .end()
         .find('.cancel_btn').click(function(e){
-            $(this).closest('.editable')
-                        .addClass('viewing')
-                        .removeClass('editing')
-                        .find('input, select, textarea').each(function(){
-                            $(this).val($(this).attr('original_val'));
-                        });
+            var $editable = $(this).closest('.editable');
+            $editable.addClass('viewing').removeClass('editing');
+            $editable.find('input:text, select, textarea').each(function(){
+                $(this).val($(this).attr('original_val'));
+            });
+            $editable.find('input[type=checkbox]').each(function(){
+                this.checked = ($(this).attr('original_val') === 'true');
+            });
             return false;
         });
 })(jQuery);


Mime
View raw message