mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
9ce0e9f4a0
closes #280 - adds image uploader to user profile page. - click on cover picture or change cover button to open file upload modal. - created new upload modal that extends model to reduce some code duplication
36 lines
1002 B
JavaScript
36 lines
1002 B
JavaScript
/*global Ghost, Backbone */
|
|
(function () {
|
|
"use strict";
|
|
Ghost.Models.uploadModal = Backbone.Model.extend({
|
|
|
|
options: {
|
|
close: false,
|
|
type: "action",
|
|
style: "wide",
|
|
animation: 'fadeIn',
|
|
afterRender: function () {
|
|
this.$('.js-drop-zone').upload();
|
|
},
|
|
confirm: {
|
|
reject: {
|
|
func: function () { // The function called on rejection
|
|
return true;
|
|
},
|
|
buttonClass: true,
|
|
text: "Cancel" // The reject button text
|
|
}
|
|
}
|
|
},
|
|
content: {
|
|
template: 'uploadImage'
|
|
},
|
|
|
|
initialize: function (options) {
|
|
this.options.id = options.id;
|
|
this.options.key = options.key;
|
|
this.options.src = options.src;
|
|
this.options.confirm.accept = options.accept;
|
|
}
|
|
});
|
|
|
|
}()); |