mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added logo selector
This commit is contained in:
@ -16,4 +16,36 @@ $(function () {
|
||||
$(this).closest('.chapter').find('.inset-list').slideToggle(180);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Vue Components
|
||||
|
||||
Vue.component('image-picker', {
|
||||
template: require('./templates/image-picker.html'),
|
||||
props: ['currentImage', 'name', 'imageClass'],
|
||||
data: function() {
|
||||
return {
|
||||
image: this.currentImage
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showImageManager: function(e) {
|
||||
var _this = this;
|
||||
ImageManager.show(function(image) {
|
||||
_this.image = image.url;
|
||||
});
|
||||
},
|
||||
reset: function() {
|
||||
this.image = '';
|
||||
},
|
||||
remove: function() {
|
||||
this.image = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Global Vue Instance
|
||||
var app = new Vue({
|
||||
el: '#app'
|
||||
});
|
@ -1,4 +1,5 @@
|
||||
var bookDashboard = new Vue({
|
||||
|
||||
new Vue({
|
||||
el: '#book-dashboard',
|
||||
data: {
|
||||
searching: false,
|
10
resources/assets/js/templates/image-picker.html
Normal file
10
resources/assets/js/templates/image-picker.html
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
<div class="image-picker">
|
||||
<div>
|
||||
<img v-if="image && image !== 'none'" v-attr="src: image, class: imageClass" alt="Image Preview">
|
||||
</div>
|
||||
<button class="button" type="button" v-on="click: showImageManager">Select Image</button>
|
||||
<br>
|
||||
<button class="text-button" v-on="click: reset" type="button">Reset</button> <span class="sep">|</span> <button class="text-button neg" v-on="click: remove" type="button">Remove</button>
|
||||
<input type="hidden" v-attr="name: name, id: name" v-model="image">
|
||||
</div>
|
Reference in New Issue
Block a user