Fixes #82: Notes do not hide when clicking image

This commit is contained in:
albert
2011-09-18 17:59:20 -04:00
parent 7b3c540bc0
commit 63d3cb337a
5 changed files with 22 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ Danbooru.Note = {
Danbooru.Note.dragging = true;
Danbooru.Note.clear_timeouts();
Danbooru.Note.Body.hide_all();
e.stopPropagation();
}
)
@@ -37,6 +38,7 @@ Danbooru.Note = {
function(e) {
var $note_box_inner = $(e.currentTarget);
Danbooru.Note.Box.resize_inner_border($note_box_inner);
e.stopPropagation();
}
);
@@ -44,6 +46,7 @@ Danbooru.Note = {
"dragstop resizestop",
function(e) {
Danbooru.Note.dragging = false;
e.stopPropagation();
}
);
@@ -60,6 +63,8 @@ Danbooru.Note = {
} else if (e.type === "mouseout") {
Danbooru.Note.Body.hide($note_box_inner.data("id"));
}
e.stopPropagation();
}
);
},
@@ -126,6 +131,10 @@ Danbooru.Note = {
$(".note-box").each(function(i, v) {
Danbooru.Note.Box.descale($(v));
});
},
toggle_all: function() {
$(".note-box").toggle();
}
},
@@ -219,18 +228,25 @@ Danbooru.Note = {
$note_body.mouseover(function(e) {
var $note_body_inner = $(e.currentTarget);
Danbooru.Note.Body.show($note_body_inner.data("id"));
e.stopPropagation();
});
$note_body.mouseout(function(e) {
var $note_body_inner = $(e.currentTarget);
Danbooru.Note.Body.hide($note_body_inner.data("id"));
e.stopPropagation();
});
if (Danbooru.meta("current-user-name") !== "Anonymous") {
$note_body.click(function(e) {
var $note_body_inner = $(e.currentTarget);
Danbooru.Note.Edit.show($note_body_inner);
e.stopPropagation();
})
} else {
$note_body.click(function(e) {
e.stopPropagation();
});
}
}
},
@@ -457,5 +473,6 @@ $(function() {
$("#note-container").width($("#image").width()).height($("#image").height());
$(document).bind("keydown", "ctrl+n", Danbooru.Note.TranslationMode.start);
Danbooru.Note.load_all();
$("#note-container").click(Danbooru.Note.Box.toggle_all);
}
});

View File

@@ -1048,6 +1048,7 @@ div#c-moderator-post-dashboards {
/*** Note Container ***/
div#note-container {
position: absolute;
z-index: 500;
div.note-body {
position: absolute;

View File

@@ -126,7 +126,7 @@ class Upload < ActiveRecord::Base
module ResizerMethods
def generate_resizes(source_path)
generate_resize_for(Danbooru.config.small_image_width, Danbooru.config.small_image_width, source_path, 80)
generate_resize_for(Danbooru.config.small_image_width, Danbooru.config.small_image_width, source_path, 85)
generate_resize_for(Danbooru.config.medium_image_width, nil, source_path)
generate_resize_for(Danbooru.config.large_image_width, nil, source_path)
end

View File

@@ -15,7 +15,7 @@ class User < ActiveRecord::Base
attr_accessor :password, :old_password
attr_accessible :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size
validates_length_of :name, :within => 2..20, :on => :create
validates_length_of :name, :within => 2..1000, :on => :create
validates_format_of :name, :with => /\A[^\s:]+\Z/, :on => :create, :message => "cannot have whitespace or colons"
validates_uniqueness_of :name, :case_sensitive => false, :on => :create
validates_uniqueness_of :email, :case_sensitive => false, :on => :create, :if => lambda {|rec| !rec.email.blank?}
@@ -122,7 +122,7 @@ class User < ActiveRecord::Base
vowels = "aeiou"
pass = ""
4.times do
6.times do
pass << consonants[rand(21), 1]
pass << vowels[rand(5), 1]
end

View File

@@ -1,6 +1,6 @@
<div id="c-note-versions">
<div id="a-index">
<table width="100%">
<table width="100%" class="striped">
<thead>
<tr>
<th></th>