注释掉的是jquery版本
drag (r) {
// var e = this
// , s = e.periods
// , t = $(r.currentTarget)
// , d = t.data("period")
// , a = t.data("hour")
// , h = !s[d].hours[a].selected;
// e.toggle(d, a, h);
// var i = t.parent(".dWrqhsbcga").find("[data-hour]");
// return i.on("mouseenter.drag", function (r) {
// r.preventDefault();
// var s = $(r.currentTarget);
// e.toggle(s.data("period"), s.data("hour"), h)
// }), $(document.body).off("mouseup.drag").on("mouseup.drag", function (r) {
// i.off("mouseenter.drag")
// }), r.preventDefault()
var e = this
, s = e.periods,
d = r.currentTarget.getAttribute('data-period')
, a = r.currentTarget.getAttribute('data-hour'),
h = !s[d].hours[a].selected
e.toggle(d, a, h);
var i = r.currentTarget.parentElement.querySelectorAll('[data-hour]')
for (var s = 0; s < i.length; s++) {
var aaa = i[s]
aaa.onmouseenter = function (r) {
// console.log('进入')
r.preventDefault()
r.cancelBubble = false
var s = r.currentTarget;
e.toggle(s.getAttribute('data-period'), s.getAttribute("data-hour"), h)
}
aaa.onmouseup = function (r, that = aaa) {
// console.log('松开')
// console.log(that.onmouseenter)
r.preventDefault()
that.onmouseenter = null
that.onmouseup = null
}
}
},
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…