Socket
Socket
Sign inDemoInstall

h5-menudropdown

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h5-menudropdown - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

package.json
{
"name": "h5-menudropdown",
"version": "0.0.7",
"version": "0.0.8",
"description": "",

@@ -5,0 +5,0 @@ "main": "src/h5-menudropdown.js",

@@ -13,9 +13,51 @@ var React = require('react');

render: function () {
var total_actions = Object.keys(this.props.actions);
var class_position = this.props.icon.split(' ');
class_position = class_position[class_position.length-1];
var style_desktop = {
marginTop: - total_actions.length * 33 + "px !important",
marginLeft: -20 + "px !important"
var menu = Object.keys(this.props.actions);
var altura_menu = menu.length * 33;
var _body = document.querySelector("body");
var largura_body = _body.offsetWidth;
var altura_body = _body.offsetHeight;
var icon = this.props.icon.split(' ');
var _icon = document.querySelector("." + icon[1]);
var left_icon;
var top_icon;
var largura_icon;
var altura_icon;
var style;
if(_icon){
left_icon = _icon.offsetLeft;
top_icon = _icon.offsetTop;
largura_icon = _icon.offsetWidth;
altura_icon = _icon.offsetHeight;
}
if(top_icon <= (altura_body/2) && left_icon <= (largura_body/2)){
style = {
left: left_icon,
top: top_icon + altura_icon,
position: 'absolute'
}
}
if(top_icon > (altura_body/2) && left_icon <= (largura_body/2)){
style = {
left: left_icon,
top: top_icon - altura_menu,
position: 'absolute'
}
}
if(top_icon <= (altura_body/2) && left_icon >= (largura_body/2)){
style = {
left: left_icon - 164,
top: top_icon + altura_icon,
position: 'absolute'
}
}
if(top_icon > (altura_body/2) && left_icon >= (largura_body/2)){
style = {
left: left_icon - 164,
top: top_icon - altura_menu,
position: 'absolute'
}
}
return (React.createElement("div", {}, [React.createElement("icon", {

@@ -25,3 +67,3 @@ className: this.props.icon + " icon_details ",

}),
this.isDropDown() ? React.createElement("div", {className: class_position, style: style_desktop}, [this.createItensMenu()]) : null
this.isDropDown() ? React.createElement("div", {style: style}, [this.createItensMenu()]) : null
]));

@@ -28,0 +70,0 @@ },

@@ -26,3 +26,3 @@ var React = require('react');

//var mock_store = {
// menu: [___fields___]
// menu: [__fields___]
//};

@@ -29,0 +29,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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