Authored by biao

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into fix/issue

... ... @@ -12,30 +12,35 @@ var $dialogWrapper,
dialogTpl,
dialogTemplate;
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
function getInstance() {
if (dialogTpl === undefined) {
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
dialogTemplate = Handlebars.compile(dialogTpl);
dialogTemplate = Handlebars.compile(dialogTpl);
}
return dialogTemplate;
}
exports.showDialog = function(data, callback, callbackForLeft) {
var dialogStr = dialogTemplate(data),
var dialogTemplate = getInstance(),
dialogStr = dialogTemplate(data),
$dialogBox,
defaultHideDuraton,
dialogWrapperHammer;
... ... @@ -73,6 +78,11 @@ exports.showDialog = function(data, callback, callbackForLeft) {
}, defaultHideDuraton);
}
//禁止在dialog上可以上下滚动
$dialogWrapper.on('touchmove', function() {
return false;
});
dialogWrapperHammer.on('tap', function(event) {
if ($(event.target).hasClass('dialog-left-btn')) {
... ... @@ -83,5 +93,9 @@ exports.showDialog = function(data, callback, callbackForLeft) {
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
}
// 防止出现点透问题
event.preventDefault();
event.srcEvent.stopPropagation();
});
};
... ...
... ... @@ -77,7 +77,7 @@
padding: 10px;
background: #000;
color: #fff;
font-size: 20px;
font-size: 12px;
@include border-radius(5px);
text-align: center;
width: 7rem;
... ...