2015-10-09 06:49:18 +08:00
|
|
|
|
|
|
|
// Global jQuery Elements
|
2015-09-03 23:51:10 +08:00
|
|
|
$(function () {
|
|
|
|
|
2015-09-04 02:05:45 +08:00
|
|
|
// Notification hiding
|
2015-09-03 23:51:10 +08:00
|
|
|
$('.notification').click(function () {
|
|
|
|
$(this).fadeOut(100);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Dropdown toggles
|
|
|
|
$('[data-dropdown]').dropDown();
|
|
|
|
|
2015-09-04 02:05:45 +08:00
|
|
|
// Chapter page list toggles
|
|
|
|
$('.chapter-toggle').click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
$(this).toggleClass('open');
|
2015-09-06 21:35:53 +08:00
|
|
|
$(this).closest('.chapter').find('.inset-list').slideToggle(180);
|
2015-09-04 02:05:45 +08:00
|
|
|
});
|
|
|
|
|
2015-10-08 06:17:48 +08:00
|
|
|
});
|
|
|
|
|
2015-10-09 06:49:18 +08:00
|
|
|
function elemExists(selector) {
|
|
|
|
return document.querySelector(selector) !== null;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Vue JS elements
|
|
|
|
var Vue = require('vue');
|
|
|
|
Vue.use(require('vue-resource'));
|
2015-10-08 06:17:48 +08:00
|
|
|
|
|
|
|
// Vue Components
|
2015-10-09 06:49:18 +08:00
|
|
|
Vue.component('image-manager', require('./components/image-manager.vue'));
|
|
|
|
Vue.component('image-picker', require('./components/image-picker.vue'));
|
2015-10-08 06:17:48 +08:00
|
|
|
|
2015-10-09 06:49:18 +08:00
|
|
|
// Vue Controllers
|
|
|
|
if(elemExists('#book-dashboard')) {
|
|
|
|
new Vue(require('./pages/book-show'));
|
|
|
|
}
|
2015-10-08 06:17:48 +08:00
|
|
|
|
|
|
|
// Global Vue Instance
|
2015-10-09 06:49:18 +08:00
|
|
|
// Needs to be loaded after all components we want to use.
|
2015-10-08 06:17:48 +08:00
|
|
|
var app = new Vue({
|
|
|
|
el: '#app'
|
2015-09-03 23:51:10 +08:00
|
|
|
});
|