Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var cardCallback = function () {
document.querySelector('.js-card-detail').classList.remove('is-hidden')
document.querySelector('.js-card-detail').classList.add('is-active')
window.scrollTo(0, 0)
Holder.run({})
// TODO: Proper URL support
var state = { test: 'TBA' }
history.pushState(state, 'TEST', '?id=' + theId)
var d
var cardBack = document.querySelectorAll('.js-card-back')
// Add click listener to each item
for (d = 0; d < cardBack.length; d++) {
cardBack[d].addEventListener('click', function (event) {
event.preventDefault()
cardBackOnClick()
})
}
initPlaceholder() {
if (
typeof window !== 'undefined' &&
typeof document !== 'undefined' &&
document.readyState === 'complete'
) {
const Holder = require('holderjs');
const domElement = document.getElementById(this.domId);
if (domElement) {
Holder.run({
domain: 'holder.js',
images: domElement,
object: null,
bgnodes: null,
stylenodes: null
})
return true;
}
}
return false;
}
mounted(){
let that = this;
if(!this.multiple) {
if(this.preview && !this.previewImg) holder.run({ images: this.$refs.simpleImg });
this.options.button = this.$refs.upload;
//upload error callback
//basic mode work only
that.options.callbacks.onError = (id, name, errorReason, xhr) => {
if(that.showMessage && typeof that.showMessage === 'function')
that.showMessage(that, errorReason);
};
if(this.beforeUpload && typeof this.beforeUpload === 'function')
that.options.callbacks.onSubmit = this.beforeUpload;
new fu.FineUploaderBasic(that.options);
}else{
that.options.deleteFile.endpoint = this.deleteFileUrl;
that.options.template = this.$refs.uploadArea;
that.options.element = this.$refs.multipleUpload;
that.options.showMessage = message => {
if(that.showMessage && typeof that.showMessage === 'function') that.showMessage(that, message);
componentDidMount() {
run({
images: this.image,
})
}