You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/09/17 21:23:56 UTC
[19/21] allura git commit: [#7955] hide Reply/link/etc column when
editing a post
[#7955] hide Reply/link/etc column when editing a post
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/02607f63
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/02607f63
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/02607f63
Branch: refs/heads/master
Commit: 02607f63db338382a691d79e574cc72365b7b66e
Parents: 46dec1a
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 16 20:07:03 2015 +0000
Committer: Heith Seewald <hs...@hsmb.local>
Committed: Thu Sep 17 15:22:38 2015 -0400
----------------------------------------------------------------------
Allura/allura/lib/widgets/discuss.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/02607f63/Allura/allura/lib/widgets/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/discuss.py b/Allura/allura/lib/widgets/discuss.py
index ff131e8..8f1ab2a 100644
--- a/Allura/allura/lib/widgets/discuss.py
+++ b/Allura/allura/lib/widgets/discuss.py
@@ -350,6 +350,16 @@ class Post(HierWidget):
if($('a.edit_post', post)){
$('a.edit_post', post).click(function (ele) {
$('.display_post', post).hide();
+
+ // remove the options column, but have to adjust the width of the middle section which is
+ // already hard-coded
+ var $opts = $('.options:first', post);
+ var opts_width = $opts.outerWidth(true);
+ $opts.hide();
+ var $post_middle = $('div.grid-14:first', post);
+ $post_middle.data('original-width', $post_middle.width());
+ $post_middle.width($post_middle.width() + opts_width);
+
var $edit_post_form = $('.edit_post_form', post);
var cm = get_cm($edit_post_form);
$edit_post_form.show();
@@ -359,7 +369,10 @@ class Post(HierWidget):
});
$("a.cancel_edit_post", post).click(function(evt){
$('.display_post', post).show();
+ $('.options', post).show();
$('.edit_post_form', post).hide();
+ var $post_middle = $('div.grid-14:first', post);
+ $post_middle.width($post_middle.data('original-width'));
});
}
if($('.reply_post', post)){