]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/global.js
Added logo selector
[bookstack] / resources / assets / js / global.js
index a75a4dc7455cfeed800a5abcb76d16da784fd998..66326da2352d9fb0edb2d0e100360f21f9635e4d 100644 (file)
@@ -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'
 });
\ No newline at end of file