Skip to content

Commit

Permalink
ui now says editing post when you are editing
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchiea committed Oct 14, 2012
1 parent b28449b commit 0bceeff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ $(function(){
editPost: function() {
var title = this.model.get('title'),
text = this.model.get('text');
// console.dir(post);
$('.post-input h2').text('Editing Post');
window.post_for_editing = this.model;
window.$('#title').val(title);
window.$('#text').val(text);
Expand Down Expand Up @@ -202,6 +202,8 @@ $(function(){
if (window.post_for_editing != undefined) { // needs logic for if post exists
window.post_for_editing.save({title: title, text: text});
window.post_for_editing = undefined;
$('.post-input h2').text('New Post');

}

else {
Expand Down
2 changes: 1 addition & 1 deletion views/admin.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%div#admin
%div.title
#post-library
%div.new-post-input
%div.post-input
%h2
New Post
%div#new-post
Expand Down

0 comments on commit 0bceeff

Please sign in to comment.