fixes #4006: Bring back the "edit tags" button to the sidebar
fixes #4011: Comment input field under posts is too big, goes slightly beyond view boundaries fixes #4010: Incorrect dynamic tag counts
This commit is contained in:
@@ -41,7 +41,7 @@ Post.initialize_all = function() {
|
||||
|
||||
var $fields_multiple = $('[data-autocomplete="tag-edit"]');
|
||||
$fields_multiple.on("keypress.danbooru", Post.update_tag_count);
|
||||
Post.update_tag_count();
|
||||
$fields_multiple.on("click", Post.update_tag_count);
|
||||
|
||||
$(window).on('danbooru:initialize_saved_seraches', () => {
|
||||
Post.initialize_saved_searches();
|
||||
@@ -421,7 +421,7 @@ Post.initialize_excerpt = function() {
|
||||
}
|
||||
|
||||
Post.initialize_post_sections = function() {
|
||||
$("#post-sections li a").on("click.danbooru", function(e) {
|
||||
$("#post-sections li a,#side-edit-link").on("click.danbooru", function(e) {
|
||||
if (e.target.hash === "#comments") {
|
||||
$("#comments").show();
|
||||
$("#edit").hide();
|
||||
@@ -432,6 +432,7 @@ Post.initialize_post_sections = function() {
|
||||
$("#post_tag_string").focus().selectEnd().height($("#post_tag_string")[0].scrollHeight);
|
||||
$("#recommended").hide();
|
||||
$(document).trigger("danbooru:open-post-edit-tab");
|
||||
Post.update_tag_count({target: $("#post_tag_string")});
|
||||
} else if (e.target.hash === "#recommended") {
|
||||
$("#comments").hide();
|
||||
$("#edit").hide();
|
||||
@@ -607,7 +608,7 @@ Post.update_tag_count = function(event) {
|
||||
let count = 0;
|
||||
|
||||
if (event) {
|
||||
let tags = $(event.target).val().match(/\S+/g);
|
||||
let tags = [...new Set($(event.target).val().match(/\S+/g))];
|
||||
if (tags) {
|
||||
count = tags.length;
|
||||
string = (count == 1) ? (count + " tag") : (count + " tags")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Uploads from './uploads';
|
||||
import Utility from './utility';
|
||||
import Post from './posts.js.erb';
|
||||
|
||||
let RelatedTag = {};
|
||||
|
||||
@@ -121,6 +122,8 @@ RelatedTag.toggle_tag = function(e) {
|
||||
// The timeout is needed on Chrome since it will clobber the field attribute otherwise
|
||||
setTimeout(function () { $field.prop('selectionStart', $field.val().length);}, 100);
|
||||
e.preventDefault();
|
||||
|
||||
Post.update_tag_count({ target: $field });
|
||||
}
|
||||
|
||||
RelatedTag.show = function(e) {
|
||||
|
||||
@@ -343,10 +343,13 @@ div#c-posts {
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
|
||||
#edit textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#favlist {
|
||||
margin-left: 1em;
|
||||
word-wrap: break-word;
|
||||
|
||||
Reference in New Issue
Block a user