Fixes #82: Notes do not hide when clicking image
This commit is contained in:
@@ -29,6 +29,7 @@ Danbooru.Note = {
|
|||||||
Danbooru.Note.dragging = true;
|
Danbooru.Note.dragging = true;
|
||||||
Danbooru.Note.clear_timeouts();
|
Danbooru.Note.clear_timeouts();
|
||||||
Danbooru.Note.Body.hide_all();
|
Danbooru.Note.Body.hide_all();
|
||||||
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ Danbooru.Note = {
|
|||||||
function(e) {
|
function(e) {
|
||||||
var $note_box_inner = $(e.currentTarget);
|
var $note_box_inner = $(e.currentTarget);
|
||||||
Danbooru.Note.Box.resize_inner_border($note_box_inner);
|
Danbooru.Note.Box.resize_inner_border($note_box_inner);
|
||||||
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ Danbooru.Note = {
|
|||||||
"dragstop resizestop",
|
"dragstop resizestop",
|
||||||
function(e) {
|
function(e) {
|
||||||
Danbooru.Note.dragging = false;
|
Danbooru.Note.dragging = false;
|
||||||
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -60,6 +63,8 @@ Danbooru.Note = {
|
|||||||
} else if (e.type === "mouseout") {
|
} else if (e.type === "mouseout") {
|
||||||
Danbooru.Note.Body.hide($note_box_inner.data("id"));
|
Danbooru.Note.Body.hide($note_box_inner.data("id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -126,6 +131,10 @@ Danbooru.Note = {
|
|||||||
$(".note-box").each(function(i, v) {
|
$(".note-box").each(function(i, v) {
|
||||||
Danbooru.Note.Box.descale($(v));
|
Danbooru.Note.Box.descale($(v));
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
toggle_all: function() {
|
||||||
|
$(".note-box").toggle();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -219,18 +228,25 @@ Danbooru.Note = {
|
|||||||
$note_body.mouseover(function(e) {
|
$note_body.mouseover(function(e) {
|
||||||
var $note_body_inner = $(e.currentTarget);
|
var $note_body_inner = $(e.currentTarget);
|
||||||
Danbooru.Note.Body.show($note_body_inner.data("id"));
|
Danbooru.Note.Body.show($note_body_inner.data("id"));
|
||||||
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
$note_body.mouseout(function(e) {
|
$note_body.mouseout(function(e) {
|
||||||
var $note_body_inner = $(e.currentTarget);
|
var $note_body_inner = $(e.currentTarget);
|
||||||
Danbooru.Note.Body.hide($note_body_inner.data("id"));
|
Danbooru.Note.Body.hide($note_body_inner.data("id"));
|
||||||
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Danbooru.meta("current-user-name") !== "Anonymous") {
|
if (Danbooru.meta("current-user-name") !== "Anonymous") {
|
||||||
$note_body.click(function(e) {
|
$note_body.click(function(e) {
|
||||||
var $note_body_inner = $(e.currentTarget);
|
var $note_body_inner = $(e.currentTarget);
|
||||||
Danbooru.Note.Edit.show($note_body_inner);
|
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());
|
$("#note-container").width($("#image").width()).height($("#image").height());
|
||||||
$(document).bind("keydown", "ctrl+n", Danbooru.Note.TranslationMode.start);
|
$(document).bind("keydown", "ctrl+n", Danbooru.Note.TranslationMode.start);
|
||||||
Danbooru.Note.load_all();
|
Danbooru.Note.load_all();
|
||||||
|
$("#note-container").click(Danbooru.Note.Box.toggle_all);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1048,6 +1048,7 @@ div#c-moderator-post-dashboards {
|
|||||||
/*** Note Container ***/
|
/*** Note Container ***/
|
||||||
div#note-container {
|
div#note-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 500;
|
||||||
|
|
||||||
div.note-body {
|
div.note-body {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class Upload < ActiveRecord::Base
|
|||||||
|
|
||||||
module ResizerMethods
|
module ResizerMethods
|
||||||
def generate_resizes(source_path)
|
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.medium_image_width, nil, source_path)
|
||||||
generate_resize_for(Danbooru.config.large_image_width, nil, source_path)
|
generate_resize_for(Danbooru.config.large_image_width, nil, source_path)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
attr_accessor :password, :old_password
|
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
|
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_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 :name, :case_sensitive => false, :on => :create
|
||||||
validates_uniqueness_of :email, :case_sensitive => false, :on => :create, :if => lambda {|rec| !rec.email.blank?}
|
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"
|
vowels = "aeiou"
|
||||||
pass = ""
|
pass = ""
|
||||||
|
|
||||||
4.times do
|
6.times do
|
||||||
pass << consonants[rand(21), 1]
|
pass << consonants[rand(21), 1]
|
||||||
pass << vowels[rand(5), 1]
|
pass << vowels[rand(5), 1]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div id="c-note-versions">
|
<div id="c-note-versions">
|
||||||
<div id="a-index">
|
<div id="a-index">
|
||||||
<table width="100%">
|
<table width="100%" class="striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
|||||||
Reference in New Issue
Block a user