mobileoa-common-modules
Version:
移动办公平台前端公共功能模块
31 lines (25 loc) • 574 B
JavaScript
;
var angular = require('angular'),
Swipe = require('swipe');
require('../modules');
angular
.module('infoDisplay.directives')
.factory('sinoSwipe', sinoSwipe);
/** @ngInject*/
function sinoSwipe($window) {
var sinoSwipe = {
swipe: null,
getInstance: getInstance
};
return sinoSwipe;
function getInstance() {
if (!sinoSwipe.swipe) {
return Swipe($window.document.getElementsByClassName('swipe')[0], {
continuous: false,
bouncing: true
});
} else {
return sinoSwipe.swipe;
}
}
}