Skip to content

Commit

Permalink
Fixes to hero image not saving properly
Browse files Browse the repository at this point in the history
  • Loading branch information
darylhedley committed May 12, 2015
1 parent 533ce38 commit 42f87df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions frontend/src/core/project/less/project.less
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@
}
}

.project-detail-hide-hero {
.field-hero-image {
display:none;
}
}

.project-settings-inner {
padding: 7px 6px;

Expand Down
1 change: 1 addition & 0 deletions frontend/src/core/project/views/projectDetailView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ define(function(require) {

if (this.model.isNew()) {
this.isNew = true;
this.$el.addClass('project-detail-hide-hero');
// Initialise the 'tags' property for a new course
this.model.set('tags', []);
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/core/scaffold/views/scaffoldAssetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ define(function(require) {

checkValueHasChanged: function() {
if ('heroImage' === this.key){
this.saveModel(true);
this.saveModel(false);
return;
}
var contentTypeId = Origin.scaffold.getCurrentModel().get('_id');
Expand Down Expand Up @@ -148,7 +148,7 @@ define(function(require) {

if ('heroImage' === this.key){
this.setValue(data.assetId);
this.saveModel(true);
this.saveModel(false);
return;
}
// Setup courseasset
Expand Down

0 comments on commit 42f87df

Please sign in to comment.