]> BookStack Code Mirror - bookstack/blob - resources/assets/js/global.js
Added logo selector
[bookstack] / resources / assets / js / global.js
1 $(function () {
2
3     // Notification hiding
4     $('.notification').click(function () {
5         $(this).fadeOut(100);
6
7     });
8
9     // Dropdown toggles
10     $('[data-dropdown]').dropDown();
11
12     // Chapter page list toggles
13     $('.chapter-toggle').click(function(e) {
14         e.preventDefault();
15         $(this).toggleClass('open');
16         $(this).closest('.chapter').find('.inset-list').slideToggle(180);
17     });
18
19 });
20
21
22 // Vue Components
23
24 Vue.component('image-picker', {
25     template: require('./templates/image-picker.html'),
26     props: ['currentImage', 'name', 'imageClass'],
27     data: function() {
28         return {
29             image: this.currentImage
30         }
31     },
32     methods: {
33         showImageManager: function(e) {
34             var _this = this;
35             ImageManager.show(function(image) {
36                 _this.image = image.url;
37             });
38         },
39         reset: function() {
40             this.image = '';
41         },
42         remove: function() {
43             this.image = 'none';
44         }
45     }
46 });
47
48 // Global Vue Instance
49 var app = new Vue({
50     el: '#app'
51 });