Authored by 陈轩

fix

... ... @@ -108,13 +108,13 @@
{{! 立刻关注抢优惠券 弹出二维码}}
<div class="ymodal" id="chit-qcode">
<div class="vh-center main" data-dismiss="ymodal">
<div class="vh-center ymodal-dialog" data-dismiss="ymodal">
<img class="qcode" src="{{imgSrc 'img/activity/vip_day/qcode.jpg'}}">
</div>
</div>
<div class="ymodal" id="qiandao-modal">
<div class="vh-center main" data-dismiss="ymodal">
<img class="qcode" src="{{imgSrc 'img/activity/vip_day/qcode.jpg'}}">
<div class="vh-center ymodal-dialog" data-dismiss="ymodal">
<img src="{{imgSrc 'img/activity/vip_day/qiandao.png'}}">
</div>
</div>
... ...
... ... @@ -27,7 +27,8 @@ var Modal = function(elem, config) {
/* ------------------------static attribute ------------------*/
Modal.DEFAULT = {
backdrop: true
backdrop: true,
show: true
};
/* ------------------------public method ------------------*/
... ... @@ -92,6 +93,12 @@ Modal._jqueryBridge = function(config, relatedTarget) {
return this.each(function() {
var $this = $(this);
var data = $this.data(DATA_KEY);
var configs = $this.data(DATA_KEY) ? 'toggle' : $.extend(
{},
Modal.DEFAULT,
$this.data(),
toString.call(config) === '[object Object]' && config
);
if (!data) {
$this.data(DATA_KEY, data = new Modal($this, config));
... ... @@ -99,7 +106,7 @@ Modal._jqueryBridge = function(config, relatedTarget) {
if (typeof config === 'string') {
data[config](relatedTarget);
} else if (config.show) {
} else if (configs.show) {
data.show(relatedTarget);
}
});
... ... @@ -108,9 +115,10 @@ Modal._jqueryBridge = function(config, relatedTarget) {
/* ----------------------- DATA-API ----------------------*/
$(document).on('click.yoho.modal.data-api', Selector.DATA_TOGGLE, function(event) {
var $this = $(this);
var selector = this.getAttribute('data-target');
var $target = $(selector);
var config = $target.data(DATA_KEY) ? 'toggle' : $.extend({show: true}, $target.data());
var config = $target.data(DATA_KEY) ? 'toggle' : $.extend($target.data(), $this.data());
if ($target[0].tagName.toUpperCase() === 'A') {
event.preventDefault();
... ...
... ... @@ -350,14 +350,21 @@
/* FLOW Element */
.vip-day {
#chit-qcode {
.main {
#chit-qcode .qcode {
width: 540px;
height: 540px;
}
#qiandao-modal img {
width: 559px;
height: 545px;
}
#chit-qcode,
#qiandao-modal {
.ymodal-dialog {
height: 100%;
}
.qcode {
width: 540px;
height: 540px;
}
}
}
... ...
... ... @@ -8,12 +8,17 @@
display: none;
}
.ymodal-dialog {
position: relative;
}
.ymodal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 998;
background-color: #000;
opacity: 0.5;
opacity: 0.8;
}
\ No newline at end of file
... ...