Skip to content

Commit

Permalink
Cleaned up a merge conflict and some more comment create stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Frankenstein committed Feb 8, 2012
1 parent 2ee12f4 commit 9402a38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drupalgap/pages/comment_edit.js
Expand Up @@ -3,6 +3,8 @@ var drupalgap_page_comment_edit_content_type;
$('#drupalgap_page_comment_edit').live('pageshow',function(){
try {

// @todo - Check the user's permissions before even attempting to do stuff with comments...

// Load node.
drupalgap_page_comment_edit_node = drupalgap_services_node_retrieve(drupalgap_page_comment_edit_nid);
if (!drupalgap_page_comment_edit_node) {
Expand Down Expand Up @@ -68,15 +70,15 @@ $('#drupalgap_page_comment_edit_submit').live('click',function(){
return false;
}

comment = drupalgap_services_comment_create({"nid":drupalgap_page_comment_edit_nid,"body":body});
comment_create_result = drupalgap_services_comment_create({"nid":drupalgap_page_comment_edit_nid,"body":body});

if (comment.cid) {
alert("Comment posted!");
$.mobile.changePage("node.html");
if (comment_create_result.errorThrown) {
alert(comment_create_result.errorThrown);
}
else {
// @todo - display a more informative message here.
alert("There was a problem posting the comment. Please review the console for more information.")''
//comment_create_result.cid
alert("Comment posted!");
$.mobile.changePage("node.html");
}
}
catch (error) {
Expand Down
1 change: 1 addition & 0 deletions drupalgap/pages/node.js
Expand Up @@ -42,6 +42,7 @@ $('#drupalgap_page_node').live('pageshow',function(){
$('#drupalgap_page_node_button_comments').show();
break;
case "2": // comments open
// @todo - check user's permissions for comments before showing buttons
$('#drupalgap_page_node_comments').show();
$('#drupalgap_page_node_button_comment').show();
$('#drupalgap_page_node_button_comments').show();
Expand Down

0 comments on commit 9402a38

Please sign in to comment.