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

nuke-touchable

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-touchable - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

4

HISTORY.md
# Changelog
## 2.0.3 / 2018-05-10
* [[d702863](http://gitlab.alibaba-inc.com/nuke/touchable/commit/d7028639b800aa42a8bc99475e8a1bdc20f1c5d0)] - `fix` fix set style bug
## 2.0.2 / 2018-05-10

@@ -5,0 +9,0 @@

26

lib/index.js

@@ -54,3 +54,5 @@ /* @jsx createElement */

_this.dom = null;
_this.originalStyle = null;
_this.activeStyle = null;
_this.rippleEnabled = isAndroid && (props.rippleEnabled || context.androidConfigs && context.androidConfigs.rippleEnabled);

@@ -83,6 +85,9 @@

value: function setStyle(styleData) {
var elementStyle = this.findDom().style;
for (var styleName in styleData) {
elementStyle[styleName] = styleData[styleName];
}
// const elementStyle = this.findDom().style;
(0, _rax.setNativeProps)(this.refs.touch, {
style: styleData
});
// for (const styleName in styleData) {
// elementStyle[styleName] = styleData[styleName];
// }
}

@@ -94,5 +99,12 @@ }, {

activeStyle = _props.activeStyle,
style = _props.style,
onTouchStart = _props.onTouchStart;
this.setStyle(activeStyle);
if (!this.originalStyle) {
this.originalStyle = _extends({}, style);
}
if (!this.activeStyle) {
this.activeStyle = _extends({}, activeStyle);
}
this.setStyle(Object.assign({}, style, activeStyle));
onTouchStart && onTouchStart(e);

@@ -107,3 +119,3 @@ }

this.setStyle(style);
this.setStyle(this.originalStyle || style);
onTouchEnd && onTouchEnd(e);

@@ -110,0 +122,0 @@ }

{
"name": "nuke-touchable",
"version": "2.0.2",
"version": "2.0.3",
"description": "可点击容器",

@@ -5,0 +5,0 @@ "main": "lib/index",

@@ -5,3 +5,9 @@ /* @jsx createElement */

import { createElement, findDOMNode, PropTypes, Component } from 'rax';
import {
createElement,
findDOMNode,
setNativeProps,
PropTypes,
Component,
} from 'rax';
import { isWeex, appInfo } from 'nuke-env';

@@ -21,3 +27,5 @@ import View from 'nuke-view';

super(props);
this.dom = null;
this.originalStyle = null;
this.activeStyle = null;
this.rippleEnabled =

@@ -45,10 +53,19 @@ isAndroid &&

setStyle(styleData) {
const elementStyle = this.findDom().style;
for (const styleName in styleData) {
elementStyle[styleName] = styleData[styleName];
}
// const elementStyle = this.findDom().style;
setNativeProps(this.refs.touch, {
style: styleData,
});
// for (const styleName in styleData) {
// elementStyle[styleName] = styleData[styleName];
// }
}
touchStart(e) {
const { activeStyle, onTouchStart } = this.props;
this.setStyle(activeStyle);
const { activeStyle, style, onTouchStart } = this.props;
if (!this.originalStyle) {
this.originalStyle = { ...style };
}
if (!this.activeStyle) {
this.activeStyle = { ...activeStyle };
}
this.setStyle(Object.assign({}, style, activeStyle));
onTouchStart && onTouchStart(e);

@@ -58,3 +75,3 @@ }

const { style, onTouchEnd } = this.props;
this.setStyle(style);
this.setStyle(this.originalStyle || style);
onTouchEnd && onTouchEnd(e);

@@ -61,0 +78,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