Add readmore.js

This commit is contained in:
Daniel Supernault 2018-11-13 12:43:46 -07:00
parent 965fd12e22
commit 06a931c1cb
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
3 changed files with 26 additions and 2 deletions

View file

@ -2,6 +2,22 @@ window.Vue = require('vue');
import BootstrapVue from 'bootstrap-vue'
Vue.use(BootstrapVue);
pixelfed.readmore = () => {
$(document).find('.read-more').each(function(k,v) {
let el = $(this);
let attr = el.attr('data-readmore');
if(typeof attr !== typeof undefined && attr !== false) {
return;
}
el.readmore({
collapsedHeight: 44,
heightMargin: 20,
moreLink: '<a href="#" class="font-weight-bold small">Read more</a>',
lessLink: '<a href="#" class="font-weight-bold small">Hide</a>',
});
});
};
window.InfiniteScroll = require('infinite-scroll');
window.filesize = require('filesize');
import swal from 'sweetalert';