From bcaa2ed0f585a96367fdab038ec12e9fe55a0276 Mon Sep 17 00:00:00 2001 From: zhujun24 Date: Mon, 17 Aug 2015 15:58:38 +0800 Subject: [PATCH 1/2] optimize close function --- components/notification/demo/with-btn-onclose.md | 6 ++++-- components/notification/demo/with-btn.md | 7 ++++--- components/notification/index.jsx | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/notification/demo/with-btn-onclose.md b/components/notification/demo/with-btn-onclose.md index 781ad54894..3b4bb237e2 100644 --- a/components/notification/demo/with-btn-onclose.md +++ b/components/notification/demo/with-btn-onclose.md @@ -9,7 +9,7 @@ ````jsx var notification = require('antd/lib/notification'); -var close = function() { +var close = function(key) { // 自定义按钮关闭时的业务处理 console.log("我被自定义的关闭按钮关闭了!"); // 隐藏提醒框 @@ -27,7 +27,9 @@ var openNotification = function() { notification.open({ message: "这是标题", description: "这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案", - btn: btn + btn: btn, + btnClose: close, + onClose: onClose }); }; diff --git a/components/notification/demo/with-btn.md b/components/notification/demo/with-btn.md index a4e0758add..985e966db6 100644 --- a/components/notification/demo/with-btn.md +++ b/components/notification/demo/with-btn.md @@ -9,8 +9,9 @@ ````jsx var notification = require('antd/lib/notification'); -var btnClick = function() { - console.log('我被自定义的按钮点击了!'); +var btnClick = function(key) { + // 隐藏提醒框 + notification.close(key); }; var close = function(){ @@ -24,7 +25,7 @@ var openNotification = function() { message: "这是标题", description: "这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案", btn: btn, - btnClose: true, + btnClose: btnClick, onClose: close }); }; diff --git a/components/notification/index.jsx b/components/notification/index.jsx index 6a87226723..55d093e825 100644 --- a/components/notification/index.jsx +++ b/components/notification/index.jsx @@ -7,7 +7,7 @@ let notificationInstance; function callback(key, btnCose) { if (btnCose) { - api.close(key); + btnCose(key); } } From 7334a0702536ba0aaf175bae014c3263e04815f2 Mon Sep 17 00:00:00 2001 From: zhujun24 Date: Mon, 17 Aug 2015 17:55:39 +0800 Subject: [PATCH 2/2] modify popconfirm & popover & tooltip placement --- components/popconfirm/demo/placement.md | 6 +++--- components/popover/demo/placement.md | 6 +++--- components/tooltip/demo/placement.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/popconfirm/demo/placement.md b/components/popconfirm/demo/placement.md index bbdcd1a12c..2f77a61ddc 100644 --- a/components/popconfirm/demo/placement.md +++ b/components/popconfirm/demo/placement.md @@ -19,15 +19,15 @@ React.render(
左边 - - 右边 - 上边 下边 + + 右边 +
, document.getElementById('components-popconfirm-demo-placement')); ```` diff --git a/components/popover/demo/placement.md b/components/popover/demo/placement.md index 09b3e643be..dd02dfcdef 100644 --- a/components/popover/demo/placement.md +++ b/components/popover/demo/placement.md @@ -18,15 +18,15 @@ React.render(
- - - + + +
, document.getElementById('components-popover-demo-placement')); ```` diff --git a/components/tooltip/demo/placement.md b/components/tooltip/demo/placement.md index e1215c21e3..c24ff96e7b 100644 --- a/components/tooltip/demo/placement.md +++ b/components/tooltip/demo/placement.md @@ -15,15 +15,15 @@ React.render( 左边左边 - - 右边右边 - 上边上边 下边下边 + + 右边右边 + , document.getElementById('components-tooltip-demo-placement')); ````