Authored by 陈轩

fix

@@ -108,13 +108,13 @@ @@ -108,13 +108,13 @@
108 108
109 {{! 立刻关注抢优惠券 弹出二维码}} 109 {{! 立刻关注抢优惠券 弹出二维码}}
110 <div class="ymodal" id="chit-qcode"> 110 <div class="ymodal" id="chit-qcode">
111 - <div class="vh-center main" data-dismiss="ymodal"> 111 + <div class="vh-center ymodal-dialog" data-dismiss="ymodal">
112 <img class="qcode" src="{{imgSrc 'img/activity/vip_day/qcode.jpg'}}"> 112 <img class="qcode" src="{{imgSrc 'img/activity/vip_day/qcode.jpg'}}">
113 </div> 113 </div>
114 </div> 114 </div>
115 115
116 <div class="ymodal" id="qiandao-modal"> 116 <div class="ymodal" id="qiandao-modal">
117 - <div class="vh-center main" data-dismiss="ymodal">  
118 - <img class="qcode" src="{{imgSrc 'img/activity/vip_day/qcode.jpg'}}"> 117 + <div class="vh-center ymodal-dialog" data-dismiss="ymodal">
  118 + <img src="{{imgSrc 'img/activity/vip_day/qiandao.png'}}">
119 </div> 119 </div>
120 </div> 120 </div>
@@ -27,7 +27,8 @@ var Modal = function(elem, config) { @@ -27,7 +27,8 @@ var Modal = function(elem, config) {
27 27
28 /* ------------------------static attribute ------------------*/ 28 /* ------------------------static attribute ------------------*/
29 Modal.DEFAULT = { 29 Modal.DEFAULT = {
30 - backdrop: true 30 + backdrop: true,
  31 + show: true
31 }; 32 };
32 33
33 /* ------------------------public method ------------------*/ 34 /* ------------------------public method ------------------*/
@@ -92,6 +93,12 @@ Modal._jqueryBridge = function(config, relatedTarget) { @@ -92,6 +93,12 @@ Modal._jqueryBridge = function(config, relatedTarget) {
92 return this.each(function() { 93 return this.each(function() {
93 var $this = $(this); 94 var $this = $(this);
94 var data = $this.data(DATA_KEY); 95 var data = $this.data(DATA_KEY);
  96 + var configs = $this.data(DATA_KEY) ? 'toggle' : $.extend(
  97 + {},
  98 + Modal.DEFAULT,
  99 + $this.data(),
  100 + toString.call(config) === '[object Object]' && config
  101 + );
95 102
96 if (!data) { 103 if (!data) {
97 $this.data(DATA_KEY, data = new Modal($this, config)); 104 $this.data(DATA_KEY, data = new Modal($this, config));
@@ -99,7 +106,7 @@ Modal._jqueryBridge = function(config, relatedTarget) { @@ -99,7 +106,7 @@ Modal._jqueryBridge = function(config, relatedTarget) {
99 106
100 if (typeof config === 'string') { 107 if (typeof config === 'string') {
101 data[config](relatedTarget); 108 data[config](relatedTarget);
102 - } else if (config.show) { 109 + } else if (configs.show) {
103 data.show(relatedTarget); 110 data.show(relatedTarget);
104 } 111 }
105 }); 112 });
@@ -108,9 +115,10 @@ Modal._jqueryBridge = function(config, relatedTarget) { @@ -108,9 +115,10 @@ Modal._jqueryBridge = function(config, relatedTarget) {
108 /* ----------------------- DATA-API ----------------------*/ 115 /* ----------------------- DATA-API ----------------------*/
109 116
110 $(document).on('click.yoho.modal.data-api', Selector.DATA_TOGGLE, function(event) { 117 $(document).on('click.yoho.modal.data-api', Selector.DATA_TOGGLE, function(event) {
  118 + var $this = $(this);
111 var selector = this.getAttribute('data-target'); 119 var selector = this.getAttribute('data-target');
112 var $target = $(selector); 120 var $target = $(selector);
113 - var config = $target.data(DATA_KEY) ? 'toggle' : $.extend({show: true}, $target.data()); 121 + var config = $target.data(DATA_KEY) ? 'toggle' : $.extend($target.data(), $this.data());
114 122
115 if ($target[0].tagName.toUpperCase() === 'A') { 123 if ($target[0].tagName.toUpperCase() === 'A') {
116 event.preventDefault(); 124 event.preventDefault();
@@ -350,14 +350,21 @@ @@ -350,14 +350,21 @@
350 350
351 /* FLOW Element */ 351 /* FLOW Element */
352 .vip-day { 352 .vip-day {
353 - #chit-qcode {  
354 - .main { 353 + #chit-qcode .qcode {
  354 + width: 540px;
  355 + height: 540px;
  356 + }
  357 +
  358 + #qiandao-modal img {
  359 + width: 559px;
  360 + height: 545px;
  361 + }
  362 +
  363 + #chit-qcode,
  364 + #qiandao-modal {
  365 + .ymodal-dialog {
355 height: 100%; 366 height: 100%;
356 } 367 }
357 - .qcode {  
358 - width: 540px;  
359 - height: 540px;  
360 - }  
361 } 368 }
362 } 369 }
363 370
@@ -8,12 +8,17 @@ @@ -8,12 +8,17 @@
8 display: none; 8 display: none;
9 } 9 }
10 10
  11 +.ymodal-dialog {
  12 + position: relative;
  13 +}
  14 +
11 .ymodal-backdrop { 15 .ymodal-backdrop {
12 position: fixed; 16 position: fixed;
13 top: 0; 17 top: 0;
14 right: 0; 18 right: 0;
15 bottom: 0; 19 bottom: 0;
16 left: 0; 20 left: 0;
  21 + z-index: 998;
17 background-color: #000; 22 background-color: #000;
18 - opacity: 0.5; 23 + opacity: 0.8;
19 } 24 }