0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #750 from cobbspur/images

Fixed settings general pane to display current blog cover in uploader
This commit is contained in:
Hannah Wolfe 2013-09-15 09:15:24 -07:00
commit 9338d93b26
2 changed files with 9 additions and 9 deletions

View file

@ -1,4 +1,4 @@
<section class="js-drop-zone"> <section class="js-drop-zone">
<img id="{{options.id}}" class="js-upload-target" src="{{options.src}}"{{#unless options.src}} style="display: none"{{/unless}} alt="logo"> <img class="js-upload-target" src="{{options.src}}"{{#unless options.src}} style="display: none"{{/unless}} alt="logo">
<input data-url="upload" class="js-fileupload" type="file" name="uploadimage"> <input data-url="upload" class="js-fileupload" type="file" name="uploadimage">
</section> </section>

View file

@ -200,15 +200,15 @@
showLogo: function (e) { showLogo: function (e) {
e.preventDefault(); e.preventDefault();
var settings = this.model.toJSON(); var settings = this.model.toJSON();
this.showUpload('#logo', 'logo', settings.logo); this.showUpload('logo', settings.logo);
}, },
showCover: function (e) { showCover: function (e) {
e.preventDefault(); e.preventDefault();
var settings = this.model.toJSON(); var settings = this.model.toJSON();
this.showUpload('#cover', 'cover', settings.icon); this.showUpload('cover', settings.cover);
}, },
showUpload: function (id, key, src) { showUpload: function (key, src) {
var self = this, upload = new Ghost.Models.uploadModal({'id': id, 'key': key, 'src': src, 'accept': { var self = this, upload = new Ghost.Models.uploadModal({'key': key, 'src': src, 'accept': {
func: function () { // The function called on acceptance func: function () { // The function called on acceptance
var data = {}, var data = {},
themes; themes;
@ -256,15 +256,15 @@
showCover: function (e) { showCover: function (e) {
e.preventDefault(); e.preventDefault();
var user = this.model.toJSON(); var user = this.model.toJSON();
this.showUpload('#user-cover', 'cover', user.cover); this.showUpload('cover', user.cover);
}, },
showImage: function (e) { showImage: function (e) {
e.preventDefault(); e.preventDefault();
var user = this.model.toJSON(); var user = this.model.toJSON();
this.showUpload('#user-image', 'image', user.image); this.showUpload('image', user.image);
}, },
showUpload: function (id, key, src) { showUpload: function (key, src) {
var self = this, upload = new Ghost.Models.uploadModal({'id': id, 'key': key, 'src': src, 'accept': { var self = this, upload = new Ghost.Models.uploadModal({'key': key, 'src': src, 'accept': {
func: function () { // The function called on acceptance func: function () { // The function called on acceptance
var data = {}; var data = {};
data[key] = this.$('.js-upload-target').attr('src'); data[key] = this.$('.js-upload-target').attr('src');