fixing doubleclick
This commit is contained in:
parent
bb5b38fb4f
commit
11e6da5592
3 changed files with 12 additions and 11 deletions
|
@ -89,18 +89,16 @@ function(HostApp, Timeline, URI, Paths, Core) {
|
||||||
|
|
||||||
var url = URI(Paths.mkApiRootPath("/profile/" + encodeURIComponent("https://tent.io/types/info/cursor/v0.1.0")));
|
var url = URI(Paths.mkApiRootPath("/profile/" + encodeURIComponent("https://tent.io/types/info/cursor/v0.1.0")));
|
||||||
var body = {
|
var body = {
|
||||||
"https://tent.io/types/info/cursor/v0.1.0": {
|
"mentions": {
|
||||||
"mentions": {
|
"https://tent.io/types/post/status/v0.1.0": {
|
||||||
"https://tent.io/types/post/status/v0.1.0": {
|
"post": status.id,
|
||||||
"post_id": status.id,
|
"entity": status.entity
|
||||||
"post_entity": status.entity
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var callback = function(resp) {
|
var callback = function(resp) {
|
||||||
//debug(resp)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Paths.getURL(url.toString(), "PUT", callback, JSON.stringify(body));
|
Paths.getURL(url.toString(), "PUT", callback, JSON.stringify(body));
|
||||||
|
@ -124,16 +122,16 @@ function(HostApp, Timeline, URI, Paths, Core) {
|
||||||
|
|
||||||
try { // don't crash when there is no cursor yet
|
try { // don't crash when there is no cursor yet
|
||||||
var body = JSON.parse(resp.responseText);
|
var body = JSON.parse(resp.responseText);
|
||||||
var cursor = body["https://tent.io/types/info/cursor/v0.1.0"]["mentions"]["https://tent.io/types/post/status/v0.1.0"];
|
var cursor = body["mentions"]["https://tent.io/types/post/status/v0.1.0"];
|
||||||
url.addSearch("since_id", cursor.post_id);
|
url.addSearch("since_id", cursor["post"]);
|
||||||
url.addSearch("since_id_entity", cursor.post_entity);
|
url.addSearch("since_id_entity", cursor["entity"]);
|
||||||
} catch(e) { }
|
} catch(e) { }
|
||||||
|
|
||||||
var callback = function(resp) {
|
var callback = function(resp) {
|
||||||
this.unread_mentions = parseInt(resp.responseText, 10);
|
this.unread_mentions = parseInt(resp.responseText, 10);
|
||||||
HostApp.unreadMentions(this.unread_mentions);
|
HostApp.unreadMentions(this.unread_mentions);
|
||||||
}
|
}
|
||||||
|
|
||||||
Paths.getURL(url.toString(), "GET", callback); // FIXME: error callback
|
Paths.getURL(url.toString(), "GET", callback); // FIXME: error callback
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,8 +340,10 @@ function(jQuery, Paths, URI, HostApp, Cache) {
|
||||||
|
|
||||||
$(template.ago).single_double_click(function () {
|
$(template.ago).single_double_click(function () {
|
||||||
HostApp.showConversation(status.id, status.entity);
|
HostApp.showConversation(status.id, status.entity);
|
||||||
|
return false;
|
||||||
}, function () {
|
}, function () {
|
||||||
HostApp.showConversationViewForPostIdandEntity(status.id, status.entity);
|
HostApp.showConversationViewForPostIdandEntity(status.id, status.entity);
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// {"type":"Point","coordinates":[57.10803113,12.25854746]}
|
// {"type":"Point","coordinates":[57.10803113,12.25854746]}
|
||||||
|
|
|
@ -23,6 +23,7 @@ jQuery.fn.single_double_click = function(single_click_callback, double_click_cal
|
||||||
clicks = 0;
|
clicks = 0;
|
||||||
}, timeout || 300);
|
}, timeout || 300);
|
||||||
}
|
}
|
||||||
|
return false; // added by jeena so it doesn't follow links
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue