Fixed mix update.

This commit is contained in:
fergal.moran
2012-09-06 11:49:50 +01:00
parent b3b0f7a896
commit a0b8a72cdd
11 changed files with 12 additions and 15 deletions

0
_working/create Executable file → Normal file
View File

0
manage.py Executable file → Normal file
View File

0
static/bin/sm/soundmanager2.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_debug.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_flash9.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_flash9_debug.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_flash_xdomain.zip Executable file → Normal file
View File

View File

@@ -62,7 +62,9 @@ var EventView = Backbone.View.extend({
});
var EventCreateView = DSSEditableView.extend({
events:{
"click #save-changes":"saveChanges"
"click #save-changes":"saveChanges",
"change input":"changed",
"change textarea":"changed"
},
initialize:function () {
this.render();

View File

@@ -126,12 +126,12 @@ window.MixView = Backbone.View.extend({
}
});
window.MixCreateView = Backbone.View.extend({
window.MixCreateView = DSSEditableView.extend({
events:{
"click #save-changes":"saveChanges",
"change #mix_image":"imageChanged",
"change input":"changed",
"change textarea":"changed",
"change #mix_image":"imageChanged"
"change textarea":"changed"
},
checkRedirect:function () {
if (this.state == 2) {
@@ -227,13 +227,6 @@ window.MixCreateView = Backbone.View.extend({
});
return false;
},
changed:function (evt) {
var changed = evt.currentTarget;
var value = $("#" + changed.id).val();
var obj = "{\"" + changed.id + "\":\"" + value + "\"}";
var objInst = JSON.parse(obj);
this.model.set(objInst);
},
imageChanged:function (evt) {
this.sendImage = true;
}

View File

@@ -64,7 +64,7 @@ window.DSSEditableView = Backbone.View.extend({
changed:function (evt) {
var changed = evt.currentTarget;
var value = $("#" + changed.id).val();
var obj = "{\"" + changed.id + "\":\"" + value + "\"}";
var obj = "{\"" + changed.id + "\":\"" + value.replace(/\n/g, '<br />') + "\"}";
var objInst = JSON.parse(obj);
this.model.set(objInst);
},

View File

@@ -62,9 +62,11 @@
</li>
</ul>
</div>
<div class="edit-button footer-button-right">
<a href="#/mix/edit/<%= item.id %>" class="btn" data-mode="<%= item.mode %>" data-id="<%= item.id %>"><i class="icon-edit"></i>Edit</a>
</div>
{% if user.is_staff %}
<div class="edit-button footer-button-right">
<a href="#/mix/edit/<%= item.id %>" class="btn" data-mode="<%= item.mode %>" data-id="<%= item.id %>"><i class="icon-edit"></i>Edit</a>
</div>
{% endif %}
</div>
</div>
</div>