Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global $ */
var svg4everybody = require('svg4everybody')
var Holder = require('holderjs') //eslint-disable-line
var FastClick = require('fastclick')
// var sortBy = require('lodash/collection/sortBy')
FastClick.attach(document.body)
svg4everybody()
console.log('testing if jquery is loaded globally:')
console.log($)
require('./test')
// NPM require
var Holder = require('holderjs');
var FastClick = require('fastclick');
FastClick.attach(document.body);
// Local require
var nav = require('./nav.js');
componentDidMount() {
require('fastclick').attach(document.body);
// setTimeout(() => this.setState({showCallout: false}), 15000);
}
import React from 'react'
import ReactDOM from 'react-dom'
import Root from './containers/root'
import 'animate.css'
import './styles/core.less'
// antd-mobile的依赖项 #576
require('fastclick').attach(document.body)
const startApp = () => {
ReactDOM.render(, document.getElementById('root'))
}
//为document添加一个数组,存放'on'方法绑定的事件及其执行函数
document.onEventsArray=[];
//document.on方法定义,类似jquery的on, 将事件方法存放至document.onEventsArray中,并用addEventListener绑定事件
document.on=function(event,fn){
let eventArr=document.onEventsArray;
const boundEvent=eventArr.filter((child)=>event===child.event);
if(boundEvent.length){
boundEvent[0].fns.push(fn)
}else{
eventArr.push({
};
//
// Initialization.
//
// Select interactive container.
// TODO: controller rather should create it itself to follow pattern of other components.
$interactiveContainer = $(viewSelector);
// Attach FastClick only to the interactive container. We don't want to affect rest of the
// web page (e.g. by attaching FastClick to "body" or window), let its developer decide whether
// FastClick should be used there or not. It solves two issues on mobile browsers:
// - eliminates 300ms delay between a physical tap and the firing of a click event
// - fixes sticky :hover state (https://www.pivotaltracker.com/story/show/58373748)
FastClick.attach($interactiveContainer[0]);
// add container to API
controller.interactiveContainer = $interactiveContainer;
// Initialize semantic layout.
semanticLayout = new SemanticLayout($interactiveContainer);
controller.on("resize.share-dialog", function () {
shareDialog.updateIframeSize();
});
loadInteractive(interactiveReference);
return controller;
};
});
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import * as fastClick from 'fastclick';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
fastClick.attach(document.body);
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
init() {
if (inited) {
return;
}
inited = true;
/*
This API depends on whether we're using the CDN or the CommonJS module
:(
*/
if (fastclick.attach !== undefined) {
fastclickInstance = fastclick.attach(document.body);
} else {
fastclickInstance = fastclick(document.body);
}
},
module.exports = function injectTapEventPlugin() {
var supportTouch = ('ontouchstart' in document);
if (supportTouch) {
Fastclick.attach(document.body);
}
};
initApp: function(){
document.addEventListener('backbutton', this.handleBackButton, false);
document.addEventListener('offline', this.onOffline, false);
document.addEventListener('online', this.onOnline, false);
document.addEventListener("resume", this.onResume, false);
if( this.isAndroid() ){
this.initAndroid();
}
if( this.isIOS() ){
this.initIOS();
}
FastClick.attach(document.body, {});
},
componentDidMount () {
require('fastclick').attach(document.body)
}