...
|
...
|
@@ -3564,10 +3564,10 @@ function getInstance() { |
|
|
'{{# hasFooter}}' +
|
|
|
'<div class="dialog-footer">' +
|
|
|
'{{# leftBtnText}}' +
|
|
|
'<span class="dialog-left-btn">{{.}}</span>' +
|
|
|
'<span class="dialog-left-btn tap-hightlight">{{.}}</span>' +
|
|
|
'{{/ leftBtnText}}' +
|
|
|
'{{# rightBtnText}}' +
|
|
|
'<span class="dialog-right-btn">{{.}}</span>' +
|
|
|
'<span class="dialog-right-btn tap-hightlight">{{.}}</span>' +
|
|
|
'{{/ rightBtnText}}' +
|
|
|
'</div>' +
|
|
|
'{{/ hasFooter}}' +
|
...
|
...
|
@@ -5496,26 +5496,40 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) { |
|
|
isSelected = isThisGoodSelected;
|
|
|
}
|
|
|
|
|
|
function preventDefault(e) {
|
|
|
console.log(e);
|
|
|
if (e.target.localName === 'ul') return;
|
|
|
e = e || window.event;
|
|
|
if (e.preventDefault)
|
|
|
function preventDefault(event) {
|
|
|
var e = event || window.event;
|
|
|
|
|
|
var $target = $(e.target);
|
|
|
|
|
|
if (($target.hasClass('.chose-items') || $target.closest('chose-items')) &&
|
|
|
($('.color-list').find('ul').not('.hide').find('li').length > 4 ||
|
|
|
$('.size-list').find('ul').not('.hide').find('li').length > 4)) {
|
|
|
e.stopPropagation();
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (e.preventDefault) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
e.returnValue = false;
|
|
|
}
|
|
|
|
|
|
function disableScroll(e) {
|
|
|
if (window.addEventListener) // older FF
|
|
|
|
|
|
// older FF
|
|
|
if (window.addEventListener) {
|
|
|
window.addEventListener('DOMMouseScroll', preventDefault, false);
|
|
|
}
|
|
|
|
|
|
window.onwheel = preventDefault; // modern standard
|
|
|
window.onmousewheel = document.onmousewheel = preventDefault; // older browsers, IE
|
|
|
window.ontouchmove = preventDefault; // mobile
|
|
|
}
|
|
|
|
|
|
function enableScroll() {
|
|
|
if (window.removeEventListener)
|
|
|
if (window.removeEventListener) {
|
|
|
window.removeEventListener('DOMMouseScroll', preventDefault, false);
|
|
|
}
|
|
|
window.onmousewheel = document.onmousewheel = null;
|
|
|
window.onwheel = null;
|
|
|
window.ontouchmove = null;
|
...
|
...
|
@@ -5563,18 +5577,6 @@ function disableNumEdit() { |
|
|
|
|
|
|
|
|
function show(html, cb) {
|
|
|
var scrollPosition = [
|
|
|
document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
|
document.documentElement.scrollTop || document.body.scrollTop
|
|
|
],
|
|
|
$html = $('html, body'); // it would make more sense to apply this to body, but IE7 won't have that
|
|
|
|
|
|
$html.data('scroll-position', scrollPosition);
|
|
|
$html.data('previous-overflow', $html.css('overflow'));
|
|
|
$html.css('overflow', 'hidden');
|
|
|
$html.css('height', '100%');
|
|
|
window.scrollTo(scrollPosition[0], scrollPosition[1]);
|
|
|
|
|
|
if (html) {
|
|
|
$chosePanel.html(html);
|
|
|
if ($('#promotionId').val() !== '') {
|
...
|
...
|
@@ -5591,15 +5593,7 @@ function show(html, cb) { |
|
|
|
|
|
//隐藏当前Panel
|
|
|
function hide() {
|
|
|
var $html = $('html, body'),
|
|
|
scrollPosition = $html.data('scroll-position');
|
|
|
|
|
|
// un-lock scroll position
|
|
|
$html.css('overflow', $html.data('previous-overflow'));
|
|
|
$html.css('height', 'auto');
|
|
|
window.scrollTo(scrollPosition[0], scrollPosition[1]);
|
|
|
$('.chose-panel').hide();
|
|
|
|
|
|
enableScroll();
|
|
|
}
|
|
|
|
...
|
...
|
|