Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge #287

  • Loading branch information...
commit 86c5e83afb8a7e7f63163c9a7f41d64cbde532cd 2 parents ca147d9 + d4dacf1
@dhcole dhcole authored
Showing with 6 additions and 7 deletions.
  1. +6 −6 _includes/views/post.js
  2. +0 −1  app.css
View
12 _includes/views/post.js
@@ -42,12 +42,12 @@ views.Post = Backbone.View.extend({
if (this.metadataEditor) this.model.raw_metadata = this.metadataEditor.getValue();
if (!this.$('.button.save').hasClass('saving')) {
this.$('.button.save').html(this.model.writeable ? "SAVE" : "SEND PATCH");
- this.$('.button.save').removeClass('inactive error');
+ this.$('.button.save').removeClass('inactive error');
}
},
showDiff: function() {
- var text1 = this.prevContent;
+ var text1 = this.model.persisted ? this.prevContent : '';
var text2 = this.serialize();
var d = this.dmp.diff_main(text1, text2);
this.dmp.diff_cleanupSemantic(d);
@@ -57,13 +57,13 @@ views.Post = Backbone.View.extend({
_toggleCommit: function() {
if (!this.$('.document-menu').hasClass('commit')) {
- this.$('.commit-message').val("Updated "+$('input.filepath').val());
+ this.$('.commit-message').val("Updated "+$('input.filepath').val());
}
this.hideMeta();
this.$('.button.save').html(this.$('.document-menu').hasClass('commit') ? (this.model.writeable ? "SAVE" : "SEND PATCH") : "COMMIT");
this.$('.button.save').toggleClass('confirm');
- this.$('.document-menu').toggleClass('commit');
+ this.$('.document-menu').toggleClass('commit');
this.$('.button.cancel-save').toggle();
this.$('.document-menu-content .options').hide();
this.showDiff();
@@ -192,7 +192,7 @@ views.Post = Backbone.View.extend({
updateFilename: function(filepath, cb) {
var that = this;
-
+
if (!_.validPathname(filepath)) return cb('error');
app.state.path = this.model.path; // ?
app.state.file = _.extractFilename(filepath)[1];
@@ -241,7 +241,7 @@ views.Post = Backbone.View.extend({
patchFile(app.state.user, app.state.repo, app.state.branch, filepath, filecontent, message, function(err) {
if (err) {
- _.delay(function() {
+ _.delay(function() {
that.$('.button.save').html("SEND PATCH");
that.$('.button.save').removeClass('error');
that.$('.button.save').addClass('inactive');
View
1  app.css
@@ -1,6 +1,5 @@
---
---
-
{% include styles/reset.css %}
{% include styles/style.css %}
{% include styles/codemirror.css %}
Please sign in to comment.
Something went wrong with that request. Please try again.