projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change all context menues for a Sone after following/unfollowing.
[Sone.git]
/
src
/
main
/
resources
/
static
/
javascript
/
sone.js
diff --git
a/src/main/resources/static/javascript/sone.js
b/src/main/resources/static/javascript/sone.js
index
383733a
..
44eee87
100644
(file)
--- a/
src/main/resources/static/javascript/sone.js
+++ b/
src/main/resources/static/javascript/sone.js
@@
-823,19
+823,32
@@
function ajaxifyPost(postElement) {
return false;
});
(function(postElement) {
return false;
});
(function(postElement) {
+ var soneId = $(".sone-id", postElement).text();
$(".sone-post-menu .follow", postElement).click(function() {
var followElement = this;
$(".sone-post-menu .follow", postElement).click(function() {
var followElement = this;
- ajaxGet("followSone.ajax", { "sone":
$(".sone-id", postElement).text()
, "formPassword": getFormPassword() }, function() {
+ ajaxGet("followSone.ajax", { "sone":
soneId
, "formPassword": getFormPassword() }, function() {
$(followElement).addClass("hidden");
$(followElement).parent().find(".unfollow").removeClass("hidden");
$(followElement).addClass("hidden");
$(followElement).parent().find(".unfollow").removeClass("hidden");
+ $("#sone .sone-menu").each(function() {
+ if (getMenuSone(this) == soneId) {
+ $(".follow", this).toggleClass("hidden", true);
+ $(".unfollow", this).toggleClass("hidden", false);
+ }
+ });
});
return false;
});
$(".sone-post-menu .unfollow", postElement).click(function() {
var unfollowElement = this;
});
return false;
});
$(".sone-post-menu .unfollow", postElement).click(function() {
var unfollowElement = this;
- ajaxGet("unfollowSone.ajax", { "sone":
$(".sone-id", postElement).text()
, "formPassword": getFormPassword() }, function() {
+ ajaxGet("unfollowSone.ajax", { "sone":
soneId
, "formPassword": getFormPassword() }, function() {
$(unfollowElement).addClass("hidden");
$(unfollowElement).parent().find(".follow").removeClass("hidden");
$(unfollowElement).addClass("hidden");
$(unfollowElement).parent().find(".follow").removeClass("hidden");
+ $("#sone .sone-menu").each(function() {
+ if (getMenuSone(this) == soneId) {
+ $(".follow", this).toggleClass("hidden", false);
+ $(".unfollow", this).toggleClass("hidden", true);
+ }
+ });
});
return false;
});
});
return false;
});