Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

m-dialog

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

m-dialog - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

23

index.js

@@ -69,3 +69,3 @@ 'use strict';

Dialog.prototype.onCancel = function onCancel(e) {
Dialog.prototype.destroy = function() {
this.setState({

@@ -75,9 +75,14 @@ visible: false

this.unmountDialog();
}
Dialog.prototype._onCancel = function onCancel(e) {
this.props.onCancel.call(this);
this.destroy();
};
Dialog.prototype.onOk = function onOk(e) {
Dialog.prototype._onOk = function onOk(e) {
// 点击确定按钮的回调函数,返回true或undefined则关闭对话框,返回false则不执行任何操作
var needUnmount = this.props.onOk.call(this);
if (needUnmount !== false) {
this.onCancel();
this._onCancel();
}

@@ -131,3 +136,3 @@ };

'div',
{ className: 'dialog-wrap ' + props.className, style: wrapStyle },
{ className: 'dialog-wrap ' + (props.className || ''), style: wrapStyle },
_react2.default.createElement(_maskM2.default, { className: dialogOverlayCls }),

@@ -139,3 +144,3 @@ _react2.default.createElement(

'b',
{ onClick: this.onCancel.bind(this) },
{ onClick: this._onCancel.bind(this) },
_react2.default.createElement('i', null, String.fromCharCode(215))

@@ -158,3 +163,3 @@ ) : false,

'span',
{ className: 'dialog-button', onClick: this.onCancel.bind(this) },
{ className: 'dialog-button', onClick: this._onCancel.bind(this) },
props.cancelText

@@ -164,3 +169,3 @@ ) : false,

'span',
{ className: okBtnCls, onClick: this.onOk.bind(this) },
{ className: okBtnCls, onClick: this._onOk.bind(this) },
props.okText

@@ -177,6 +182,6 @@ )

Dialog.confirm = function (opt) {
_reactDom2.default.render(_react2.default.createElement(Dialog, _extends({ okBtnClass: 'btn-primary' }, opt, { confirm: true })), con);
return _reactDom2.default.render(_react2.default.createElement(Dialog, _extends({ okBtnClass: 'btn-primary' }, opt, { confirm: true })), con);
};
Dialog.alert = function (opt) {
_reactDom2.default.render(_react2.default.createElement(Dialog, _extends({ okBtnClass: '' }, opt)), con);
return _reactDom2.default.render(_react2.default.createElement(Dialog, _extends({ okBtnClass: '' }, opt)), con);
};

@@ -183,0 +188,0 @@ Dialog.defaultProps = {

{
"name": "m-dialog",
"version": "1.0.4",
"version": "1.1.0",
"description": "m-dialog 移动端模态对话框",

@@ -24,3 +24,3 @@ "main": "index.js",

{
"name": "柏舟",
"name": "margox",
"email": "margox@foxmail.com"

@@ -27,0 +27,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc