2016-10-26 23:57:27 +00:00
|
|
|
import $ from 'jquery';
|
2016-11-03 09:02:16 +00:00
|
|
|
|
2017-03-31 18:21:41 +00:00
|
|
|
/* Materialize imports */
|
|
|
|
import 'materialize-css/dist/css/materialize.css';
|
|
|
|
import 'materialize-css/dist/js/materialize';
|
|
|
|
|
|
|
|
/* Global imports */
|
|
|
|
import '../_global/index';
|
2016-11-03 09:02:16 +00:00
|
|
|
|
|
|
|
/* Tools */
|
2017-03-31 18:21:41 +00:00
|
|
|
import { initExport, initFilters } from './js/tools';
|
2016-11-03 09:02:16 +00:00
|
|
|
|
|
|
|
/* Import shortcuts */
|
2017-03-31 18:21:41 +00:00
|
|
|
import './js/shortcuts/main';
|
|
|
|
import './js/shortcuts/entry';
|
2016-10-04 13:30:05 +00:00
|
|
|
|
2017-03-31 18:21:41 +00:00
|
|
|
/* Theme style */
|
|
|
|
import './css/index.scss';
|
2016-03-08 16:02:34 +00:00
|
|
|
|
2016-09-28 08:30:18 +00:00
|
|
|
$(document).ready(() => {
|
2016-06-09 17:02:38 +00:00
|
|
|
// sideNav
|
|
|
|
$('.button-collapse').sideNav();
|
|
|
|
$('select').material_select();
|
|
|
|
$('.collapsible').collapsible({
|
|
|
|
accordion: false,
|
|
|
|
});
|
|
|
|
$('.datepicker').pickadate({
|
|
|
|
selectMonths: true,
|
|
|
|
selectYears: 15,
|
|
|
|
formatSubmit: 'dd/mm/yyyy',
|
|
|
|
hiddenName: true,
|
|
|
|
format: 'dd/mm/yyyy',
|
2017-03-31 18:21:41 +00:00
|
|
|
container: 'body',
|
2016-06-09 17:02:38 +00:00
|
|
|
});
|
|
|
|
initFilters();
|
|
|
|
initExport();
|
2015-08-04 16:39:26 +00:00
|
|
|
|
2016-09-28 08:30:18 +00:00
|
|
|
$('#nav-btn-add-tag').on('click', () => {
|
2016-06-09 17:02:38 +00:00
|
|
|
$('.nav-panel-add-tag').toggle(100);
|
|
|
|
$('.nav-panel-menu').addClass('hidden');
|
|
|
|
$('#tag_label').focus();
|
|
|
|
return false;
|
|
|
|
});
|
2016-09-28 08:30:18 +00:00
|
|
|
$('#nav-btn-add').on('click', () => {
|
2016-06-09 17:02:38 +00:00
|
|
|
$('.nav-panel-buttom').hide(100);
|
|
|
|
$('.nav-panel-add').show(100);
|
|
|
|
$('.nav-panels .action').hide(100);
|
|
|
|
$('.nav-panel-menu').addClass('hidden');
|
|
|
|
$('.nav-panels').css('background', 'white');
|
|
|
|
$('#entry_url').focus();
|
|
|
|
return false;
|
|
|
|
});
|
2016-09-28 08:30:18 +00:00
|
|
|
$('#nav-btn-search').on('click', () => {
|
2016-06-09 17:02:38 +00:00
|
|
|
$('.nav-panel-buttom').hide(100);
|
|
|
|
$('.nav-panel-search').show(100);
|
|
|
|
$('.nav-panels .action').hide(100);
|
|
|
|
$('.nav-panel-menu').addClass('hidden');
|
|
|
|
$('.nav-panels').css('background', 'white');
|
2016-11-04 22:24:43 +00:00
|
|
|
$('#search_entry_term').focus();
|
2016-06-09 17:02:38 +00:00
|
|
|
return false;
|
|
|
|
});
|
2016-09-28 08:30:18 +00:00
|
|
|
$('.close').on('click', () => {
|
2016-06-09 17:02:38 +00:00
|
|
|
$('.nav-panel-add').hide(100);
|
|
|
|
$('.nav-panel-search').hide(100);
|
|
|
|
$('.nav-panel-buttom').show(100);
|
|
|
|
$('.nav-panels .action').show(100);
|
|
|
|
$('.nav-panel-menu').removeClass('hidden');
|
|
|
|
$('.nav-panels').css('background', 'transparent');
|
|
|
|
return false;
|
|
|
|
});
|
2016-09-28 08:30:18 +00:00
|
|
|
$(window).scroll(() => {
|
|
|
|
const s = $(window).scrollTop();
|
|
|
|
const d = $(document).height();
|
|
|
|
const c = $(window).height();
|
|
|
|
const scrollPercent = (s / (d - c)) * 100;
|
|
|
|
$('.progress .determinate').css('width', `${scrollPercent}%`);
|
2016-06-09 17:02:38 +00:00
|
|
|
});
|
2015-08-11 16:07:02 +00:00
|
|
|
});
|