Authored by 沈志敏

fix bug

@@ -103,6 +103,8 @@ @@ -103,6 +103,8 @@
103 103
104 $('#li-' + id).css('transform', 'translateX(-' + width + 'px)'); 104 $('#li-' + id).css('transform', 'translateX(-' + width + 'px)');
105 delBtn.removeClass('hide'); 105 delBtn.removeClass('hide');
  106 + this.pandata.id = id;
  107 + this.pandata.objX = -width;
106 }, 108 },
107 hideDelBth() { 109 hideDelBth() {
108 this.brandData.forEach(function(d) { 110 this.brandData.forEach(function(d) {
@@ -137,7 +139,7 @@ @@ -137,7 +139,7 @@
137 }, 139 },
138 panstart: function(id) { 140 panstart: function(id) {
139 event.preventDefault(); 141 event.preventDefault();
140 - if (this.editmodel) { 142 + if (this.editmodel && this.pandata.id !== id) {
141 return false; 143 return false;
142 } 144 }
143 145
@@ -155,7 +157,7 @@ @@ -155,7 +157,7 @@
155 }, 157 },
156 panmove: function(id) { 158 panmove: function(id) {
157 event.preventDefault(); 159 event.preventDefault();
158 - if (this.editmodel) { 160 + if (this.editmodel && this.pandata.id !== id) {
159 return false; 161 return false;
160 } 162 }
161 163
@@ -182,7 +184,7 @@ @@ -182,7 +184,7 @@
182 }, 184 },
183 panend: function(id) { 185 panend: function(id) {
184 event.preventDefault(); 186 event.preventDefault();
185 - if (this.editmodel) { 187 + if (this.editmodel && this.pandata.id !== id) {
186 return false; 188 return false;
187 } 189 }
188 190
@@ -197,6 +199,10 @@ @@ -197,6 +199,10 @@
197 this.pandata.objX = -width; 199 this.pandata.objX = -width;
198 } 200 }
199 li.css('transform', 'translateX(' + this.pandata.objX + 'px)'); 201 li.css('transform', 'translateX(' + this.pandata.objX + 'px)');
  202 +
  203 + if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) {
  204 + this.pandata = {};
  205 + }
200 } 206 }
201 }, 207 },
202 created: function() { 208 created: function() {
@@ -249,6 +255,7 @@ @@ -249,6 +255,7 @@
249 padding-left: 20px; 255 padding-left: 20px;
250 list-style: none; 256 list-style: none;
251 overflow: hidden; 257 overflow: hidden;
  258 + border-top: 1px solid #e0e0e0;
252 259
253 li { 260 li {
254 position: relative; 261 position: relative;
@@ -120,6 +120,8 @@ @@ -120,6 +120,8 @@
120 120
121 delBtn.removeClass('hide'); 121 delBtn.removeClass('hide');
122 $('#li-' + id).css('transform', 'translateX(-' + width + 'px)'); 122 $('#li-' + id).css('transform', 'translateX(-' + width + 'px)');
  123 + this.pandata.id = id;
  124 + this.pandata.objX = -width;
123 }, 125 },
124 hideDelBth() { 126 hideDelBth() {
125 this.productData.forEach(function(d) { 127 this.productData.forEach(function(d) {
@@ -154,7 +156,7 @@ @@ -154,7 +156,7 @@
154 }, 156 },
155 panstart: function(id) { 157 panstart: function(id) {
156 event.preventDefault(); 158 event.preventDefault();
157 - if (this.editmodel) { 159 + if (this.editmodel && this.pandata.id !== id) {
158 return false; 160 return false;
159 } 161 }
160 162
@@ -172,7 +174,7 @@ @@ -172,7 +174,7 @@
172 }, 174 },
173 panmove: function(id) { 175 panmove: function(id) {
174 event.preventDefault(); 176 event.preventDefault();
175 - if (this.editmodel) { 177 + if (this.editmodel && this.pandata.id !== id) {
176 return false; 178 return false;
177 } 179 }
178 180
@@ -199,7 +201,7 @@ @@ -199,7 +201,7 @@
199 }, 201 },
200 panend: function(id) { 202 panend: function(id) {
201 event.preventDefault(); 203 event.preventDefault();
202 - if (this.editmodel) { 204 + if (this.editmodel && this.pandata.id !== id) {
203 return false; 205 return false;
204 } 206 }
205 207
@@ -214,6 +216,10 @@ @@ -214,6 +216,10 @@
214 this.pandata.objX = -width; 216 this.pandata.objX = -width;
215 } 217 }
216 li.css('transform', 'translateX(' + this.pandata.objX + 'px)'); 218 li.css('transform', 'translateX(' + this.pandata.objX + 'px)');
  219 +
  220 + if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) {
  221 + this.pandata = {};
  222 + }
217 } 223 }
218 }, 224 },
219 created: function() { 225 created: function() {
@@ -266,6 +272,7 @@ @@ -266,6 +272,7 @@
266 padding-left: 20px; 272 padding-left: 20px;
267 list-style: none; 273 list-style: none;
268 overflow: hidden; 274 overflow: hidden;
  275 + border-top: 1px solid #e0e0e0;
269 276
270 li { 277 li {
271 position: relative; 278 position: relative;