diff --git a/public_html/css/post.css b/public_html/css/post.css index a7743940..17fb8779 100644 --- a/public_html/css/post.css +++ b/public_html/css/post.css @@ -166,6 +166,9 @@ z-index: -1; } +#post-edit-target .advanced-trigger .form-input { + overflow: auto; /* fix browser's outline around the link being cut due to overflow: hidden; */ +} #post-edit-target .file-handler { margin: 0.5em 0; } diff --git a/public_html/js/Presenters/PostEditPresenter.js b/public_html/js/Presenters/PostEditPresenter.js index 92b73624..7acf32c5 100644 --- a/public_html/js/Presenters/PostEditPresenter.js +++ b/public_html/js/Presenters/PostEditPresenter.js @@ -47,7 +47,20 @@ App.Presenters.PostEditPresenter = function( } function render() { - $target.html(templates.postEdit({post: post, privileges: privileges})); + var $template = jQuery(templates.postEdit({post: post, privileges: privileges})); + + var $advanced = $template.find('.advanced'); + var $advancedTrigger = $template.find('.advanced-trigger'); + $advanced.hide(); + if (!$advanced.length) { + $advancedTrigger.hide(); + } else { + $advancedTrigger.find('a').click(function(e) { + advancedTriggerClicked(e, $advanced, $advancedTrigger); + }); + } + + $target.html($template); postContentFileDropper = new App.Controls.FileDropper($target.find('form [name=content]')); postContentFileDropper.onChange = postContentChanged; @@ -64,6 +77,12 @@ App.Presenters.PostEditPresenter = function( $target.find('form').submit(editFormSubmitted); } + function advancedTriggerClicked(e, $advanced, $advancedTrigger) { + $advancedTrigger.hide(); + $advanced.show(); + e.preventDefault(); + } + function focus() { if (tagInput) { tagInput.focus(); diff --git a/public_html/templates/post-edit.tpl b/public_html/templates/post-edit.tpl index 79bac1a5..6e3ad4c7 100644 --- a/public_html/templates/post-edit.tpl +++ b/public_html/templates/post-edit.tpl @@ -30,8 +30,15 @@ <% } %> +
+ +
+ Advanced… +
+
+ <% if (privileges.canChangeSource) { %> -
+
@@ -40,7 +47,7 @@ <% } %> <% if (privileges.canChangeRelations) { %> -
+
@@ -49,7 +56,7 @@ <% } %> <% if (privileges.canChangeFlags && post.contentType === 'video') { %> -
+
/> @@ -61,7 +68,7 @@ <% } %> <% if (privileges.canChangeContent) { %> -
+
@@ -70,7 +77,7 @@ <% } %> <% if (privileges.canChangeThumbnail) { %> -
+