Browse Source

feat: 上传图片使用点击外部区域来关闭上传的popover

node 6 years ago
parent
commit
7bd795bea0

+ 1
- 1
assets/example.html View File

20
   </div>
20
   </div>
21
   
21
   
22
   <script src="http://gosspublic.alicdn.com/aliyun-oss-sdk.min.js"></script>
22
   <script src="http://gosspublic.alicdn.com/aliyun-oss-sdk.min.js"></script>
23
-  <script type="text/javascript" src="./static/js/main.9d10db91.js"></script>
23
+  <script type="text/javascript" src="./static/js/main.2917e503.js"></script>
24
   <script type="text/javascript" src="example.js"></script>
24
   <script type="text/javascript" src="example.js"></script>
25
 </body>
25
 </body>
26
 </html>
26
 </html>

assets/static/js/main.2917e503.js
File diff suppressed because it is too large
View File


+ 1
- 0
assets/static/js/main.2917e503.js.map
File diff suppressed because it is too large
View File


+ 0
- 1
assets/static/js/main.9d10db91.js.map
File diff suppressed because it is too large
View File


+ 8
- 4
src/components/Editor/index.js View File

236
               {showUpload ? (
236
               {showUpload ? (
237
                 <Popover
237
                 <Popover
238
                   trigger="click"
238
                   trigger="click"
239
-                  visible={this.state.showUpload}
239
+                  // TODO: 针对非 react.js,直接使用 click 事件来控制展开或关闭
240
+                  // visible={this.state.showUpload}
240
                   overlayStyle={{ zIndex: 999 }}
241
                   overlayStyle={{ zIndex: 999 }}
241
                   onVisibleChange={
242
                   onVisibleChange={
242
                     closeUploadWhenBlur
243
                     closeUploadWhenBlur
271
                         上传图片
272
                         上传图片
272
                         {maxUpload >= 2 ? (
273
                         {maxUpload >= 2 ? (
273
                           <span style={{ color: "#666", fontWeight: 400 }}>
274
                           <span style={{ color: "#666", fontWeight: 400 }}>
274
-                            (您还能上传{maxUpload - this.state.fileList.length}张图片)
275
+                            (您还能上传
276
+                            {maxUpload - this.state.fileList.length}
277
+                            张图片)
275
                           </span>
278
                           </span>
276
                         ) : null}
279
                         ) : null}
277
                       </span>
280
                       </span>
278
-                      <Icon
281
+                      {/* 因为是点击别的区域关闭,所以不用右上角的 Icon */}
282
+                      {/* <Icon
279
                         type="close"
283
                         type="close"
280
                         onClick={() => this.handleShowUpload(false)}
284
                         onClick={() => this.handleShowUpload(false)}
281
                         style={{
285
                         style={{
283
                           cursor: "pointer",
287
                           cursor: "pointer",
284
                           marginTop: 4
288
                           marginTop: 4
285
                         }}
289
                         }}
286
-                      />
290
+                      /> */}
287
                     </div>
291
                     </div>
288
                   }
292
                   }
289
                 >
293
                 >