Browse Source

[FIX] menu position

deisy 6 years ago
parent
commit
918419269c

+ 0 - 2
static/src/css/smart-dropdown-menu-dev.css

@@ -1,2 +0,0 @@
-.smart-dropdown-menu.dev .sdm-list > li:before, .smart-dropdown-menu.dev .sdm-list > li:after {
-  background-color: rgba(0, 0, 0, 0.4); }

+ 0 - 132
static/src/css/smart-dropdown-menu.css

@@ -1,132 +0,0 @@
-.smart-dropdown-menu {
-  display: inline-block;
-  position: relative;
-  top: 0;
-  left: 10px;
-  height: 100%; }
-  .smart-dropdown-menu.show > .sdm-list {
-    width: auto;
-    opacity: 1;
-    height: auto;
-    visibility: visible; }
-  .smart-dropdown-menu.animating > .sdm-list {
-    width: auto; }
-  .smart-dropdown-menu .sdm-list {
-    box-sizing: border-box;
-    list-style: none;
-    position: absolute;
-    top: 0px;
-    left: 0px;
-    margin: 50px 0 0;
-    padding: 0;
-    display: block;
-    z-index: 10;
-    color: #cccccc;
-    width: 0;
-    height: 0;
-    opacity: 0;
-    visibility: hidden; }
-    .smart-dropdown-menu .sdm-list:before {
-      content: "";
-      display: block;
-      width: 100%;
-      height: 100%;
-      padding: 50px 10px 10px;
-      position: absolute;
-      top: -50px;
-      left: -10px; }
-    .smart-dropdown-menu .sdm-list li {
-      white-space: nowrap;
-      position: static;
-      line-height: 32px;
-      background-color: #444444; }
-      .smart-dropdown-menu .sdm-list li a {
-        display: block;
-        position: relative;
-        color: #cccccc;
-        text-decoration: none;
-        padding: 5px 10px 5px 10px;
-        cursor: pointer; }
-      .smart-dropdown-menu .sdm-list li:hover > a, .smart-dropdown-menu .sdm-list li:active > a {
-        color: #ffffff; }
-      .smart-dropdown-menu .sdm-list li:before, .smart-dropdown-menu .sdm-list li:after {
-        content: "";
-        display: none;
-        position: absolute;
-        width: 50%;
-        left: 50%;
-        z-index: 10; }
-      .smart-dropdown-menu .sdm-list li:before {
-        top: 0;
-        transform-origin: bottom left; }
-      .smart-dropdown-menu .sdm-list li:after {
-        top: auto;
-        transform-origin: top left; }
-      .smart-dropdown-menu .sdm-list li.show:before, .smart-dropdown-menu .sdm-list li.show:after {
-        display: block; }
-  .smart-dropdown-menu li > .sdm-list {
-    position: absolute;
-    display: none;
-    width: auto;
-    height: auto;
-    min-height: 100%;
-    margin: 0;
-    top: 0px;
-    left: 100%;
-    background-color: #444444;
-    z-index: 20; }
-    .smart-dropdown-menu li > .sdm-list > li {
-      position: relative; }
-  .smart-dropdown-menu li.show > .sdm-list {
-    display: block;
-    visibility: visible;
-    opacity: 1; }
-
-.smart-dropdown-menu-button {
-  box-sizing: border-box;
-  display: block;
-  width: 35px;
-  height: 100%;
-  position: relative;
-  cursor: pointer;
-  z-index: 20;
-  padding: 0 5px; }
-  .smart-dropdown-menu-button span {
-    display: block;
-    margin: 0 auto;
-    width: 100%;
-    height: 4px;
-    background-color: #f0f0f0;
-    border-radius: 4px;
-    position: relative;
-    top: 50%;
-    margin-top: -2px; }
-    .smart-dropdown-menu-button span:before, .smart-dropdown-menu-button span:after {
-      content: "";
-      display: block;
-      position: absolute;
-      width: 100%;
-      height: 100%;
-      background-color: #f0f0f0;
-      border-radius: 4px; }
-    .smart-dropdown-menu-button span:before {
-      top: -8px; }
-    .smart-dropdown-menu-button span:after {
-      top: 8px; }
-
-.smart-dropdown-menu.light-theme .sdm-list {
-  color: #565656; }
-  .smart-dropdown-menu.light-theme .sdm-list li {
-    background-color: #fcfcfc; }
-    .smart-dropdown-menu.light-theme .sdm-list li a {
-      color: #565656; }
-    .smart-dropdown-menu.light-theme .sdm-list li:hover > a, .smart-dropdown-menu.light-theme .sdm-list li:active > a {
-      color: #333333; }
-
-.smart-dropdown-menu.light-theme li > .sdm-list {
-  background-color: #fcfcfc; }
-  .smart-dropdown-menu.light-theme li > .sdm-list > li {
-    position: relative; }
-
-.smart-dropdown-menu.light-theme .smart-dropdown-menu-button span, .smart-dropdown-menu.light-theme .smart-dropdown-menu-button span:before, .smart-dropdown-menu.light-theme .smart-dropdown-menu-button span:after {
-  background-color: #565656; }

+ 0 - 229
static/src/js/smart-dropdown-menu.js

@@ -1,229 +0,0 @@
-/**
- * @yami-beta/smart-dropdown-menu
- *
- * Copyright (c) 2016 Takahiro Abe
- *
- * This software is released under the MIT license
- */
-(function (global, factory) {
-  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
-  typeof define === 'function' && define.amd ? define(factory) :
-  (global.SmartDropdownMenu = factory());
-}(this, (function () { 'use strict';
-
-var classCallCheck = function (instance, Constructor) {
-  if (!(instance instanceof Constructor)) {
-    throw new TypeError("Cannot call a class as a function");
-  }
-};
-
-var createClass = function () {
-  function defineProperties(target, props) {
-    for (var i = 0; i < props.length; i++) {
-      var descriptor = props[i];
-      descriptor.enumerable = descriptor.enumerable || false;
-      descriptor.configurable = true;
-      if ("value" in descriptor) descriptor.writable = true;
-      Object.defineProperty(target, descriptor.key, descriptor);
-    }
-  }
-
-  return function (Constructor, protoProps, staticProps) {
-    if (protoProps) defineProperties(Constructor.prototype, protoProps);
-    if (staticProps) defineProperties(Constructor, staticProps);
-    return Constructor;
-  };
-}();
-
-
-
-
-
-
-
-var get = function get(object, property, receiver) {
-  if (object === null) object = Function.prototype;
-  var desc = Object.getOwnPropertyDescriptor(object, property);
-
-  if (desc === undefined) {
-    var parent = Object.getPrototypeOf(object);
-
-    if (parent === null) {
-      return undefined;
-    } else {
-      return get(parent, property, receiver);
-    }
-  } else if ("value" in desc) {
-    return desc.value;
-  } else {
-    var getter = desc.get;
-
-    if (getter === undefined) {
-      return undefined;
-    }
-
-    return getter.call(receiver);
-  }
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var set = function set(object, property, value, receiver) {
-  var desc = Object.getOwnPropertyDescriptor(object, property);
-
-  if (desc === undefined) {
-    var parent = Object.getPrototypeOf(object);
-
-    if (parent !== null) {
-      set(parent, property, value, receiver);
-    }
-  } else if ("value" in desc && desc.writable) {
-    desc.value = value;
-  } else {
-    var setter = desc.set;
-
-    if (setter !== undefined) {
-      setter.call(receiver, value);
-    }
-  }
-
-  return value;
-};
-
-var SmartDropdownMenuItem = function () {
-  function SmartDropdownMenuItem(el, index) {
-    classCallCheck(this, SmartDropdownMenuItem);
-
-    this.el = el;
-    this.index = index;
-    this.el.classList.add('item' + this.index);
-
-    this.el.addEventListener('mouseover', this.openSubmenu.bind(this));
-    this.el.addEventListener('mouseout', this.closeSubmenu.bind(this));
-  }
-
-  createClass(SmartDropdownMenuItem, [{
-    key: 'openSubmenu',
-    value: function openSubmenu() {
-      this.el.classList.add('show');
-    }
-  }, {
-    key: 'closeSubmenu',
-    value: function closeSubmenu() {
-      this.el.classList.remove('show');
-    }
-  }]);
-  return SmartDropdownMenuItem;
-}();
-
-var SmartDropdownMenu = function () {
-  function SmartDropdownMenu(node) {
-    classCallCheck(this, SmartDropdownMenu);
-
-    this.el = node;
-    this.items = [];
-
-    var menuItem = document.querySelectorAll('.smart-dropdown-menu > .sdm-list > li');
-    for (var i = 0; i < menuItem.length; i++) {
-      this.items.push(new SmartDropdownMenuItem(menuItem[i], i));
-    }
-
-    this.el.addEventListener('mouseover', this.showMenu.bind(this));
-    this.el.addEventListener('mouseout', this.hideMenu.bind(this));
-    this.showMenu();
-    this.appendTriareaStyle();
-    this.hideMenu();
-  }
-
-  createClass(SmartDropdownMenu, [{
-    key: 'showMenu',
-    value: function showMenu(event) {
-      this.el.classList.add('show');
-    }
-  }, {
-    key: 'hideMenu',
-    value: function hideMenu(event) {
-      this.el.classList.remove('show');
-    }
-  }, {
-    key: 'appendTriareaStyle',
-    value: function appendTriareaStyle() {
-      // <style> for triarea
-      var styleTag = document.getElementById('smart-dropdown-menu-style');
-      if (!styleTag) {
-        styleTag = document.createElement('style');
-        styleTag.type = 'text/css';
-        styleTag.id = 'smart-dropdown-menu-style';
-        document.querySelector('head').appendChild(styleTag);
-      }
-      var styleObj = this.calculateTriarea();
-      styleTag.innerHTML = this.objectToStyle(styleObj);
-    }
-  }, {
-    key: 'calculateTriarea',
-    value: function calculateTriarea() {
-      // "triarea" extend hover area of menu for mouse cursor's diagonal movement
-      var menuListSub = this.el.querySelector('li');
-      var menuItemWidth = menuListSub.offsetWidth;
-      var menuItemHeight = menuListSub.offsetHeight;
-      var triareaStyleObj = {};
-
-      for (var i = 0; i < this.items.length; i++) {
-        this.items[i].openSubmenu();
-
-        // calc angle of elevation
-        var elevation = Math.floor(Math.atan2(menuItemWidth * 0.5, menuItemHeight * i + menuItemHeight / 2) * 180 / Math.PI);
-        triareaStyleObj['.item' + i + ':before'] = {
-          'height': menuItemHeight * i + menuItemHeight / 2 + 'px',
-          'transform': 'skewX(-' + elevation + 'deg)'
-        };
-
-        var submenuHeight = this.items[i].el.querySelector('.sdm-list').offsetHeight;
-        var height = submenuHeight - menuItemHeight / 2 - menuItemHeight * i;
-        // calc angle of depression
-        var depression = Math.floor(Math.atan2(menuItemWidth * 0.5, height) * 180 / Math.PI);
-        triareaStyleObj['.item' + i + ':after'] = {
-          'margin-top': '-' + menuItemHeight / 2 + 'px',
-          'height': height + 'px',
-          'transform': 'skewX(' + depression + 'deg)'
-        };
-
-        this.items[i].closeSubmenu();
-      }
-
-      return triareaStyleObj;
-    }
-  }, {
-    key: 'objectToStyle',
-    value: function objectToStyle(obj) {
-      var styleText = '';
-      Object.keys(obj).forEach(function (selector) {
-        styleText += selector + '{';
-        Object.keys(obj[selector]).forEach(function (property) {
-          styleText += property + ': ' + obj[selector][property] + ';';
-        });
-        styleText += '}';
-      });
-      return styleText;
-    }
-  }]);
-  return SmartDropdownMenu;
-}();
-
-return SmartDropdownMenu;
-
-})));

File diff suppressed because it is too large
+ 0 - 7
static/src/js/smart-dropdown-menu.min.js


+ 4 - 4
views/registration_menu.xml

@@ -9,19 +9,19 @@
         <menuitem name="Registros" id="menu_registrations" sequence="3"/>
 
         <!-- Ventas -->
-        <menuitem name="Ventas" id="eiru_base_menu.menu_registration_sales" parent="eiru_base_menu.menu_registrations" sequence="0" />
+        <menuitem name="Ventas" id="eiru_base_menu.menu_registration_sales" parent="eiru_base_menu.menu_registrations" sequence="10" />
               <menuitem name="Registrar clientes" id="base.menu_partner_form" parent="eiru_base_menu.menu_registration_sales" sequence="1"/>
               <menuitem name="Registrar contrato de cliente" id="account_analytic_analysis.menu_action_account_analytic_overdue_all" parent="eiru_base_menu.menu_registration_sales" sequence="2"/>
               <menuitem id="product.menu_product_pricelist_action" name="Registrar tarifa de precio de venta" parent="eiru_base_menu.menu_registration_sales" sequence="3"/>
 
         <!-- Compras -->
-        <menuitem name="Compras" id="eiru_base_menu.menu_registration_purchases" parent="eiru_base_menu.menu_registrations" sequence="1"/>
+        <menuitem name="Compras" id="eiru_base_menu.menu_registration_purchases" parent="eiru_base_menu.menu_registrations" sequence="20"/>
               <menuitem name="Registrar proveedores" id="base.menu_procurement_management_supplier_name" parent="eiru_base_menu.menu_registration_purchases" sequence="1"/>
               <menuitem name="Registrar contrato de proveedor" id="account_analytic_purchase_contract.contract_purchase" parent="eiru_base_menu.menu_registration_purchases" sequence="2"/>
               <menuitem name="Registrar tarifa de compra" id="purchase.menu_purchase_pricelist_version_action" parent="eiru_base_menu.menu_registration_purchases" sequence="3"/>
 
         <!-- Productos -->
-        <menuitem name="Productos" id="eiru_base_menu.menu_producto" parent="menu_registrations" sequence="2"/>
+        <menuitem name="Productos" id="eiru_base_menu.menu_producto" parent="menu_registrations" sequence="30"/>
               <menuitem name="Registrar productos" id="product.menu_product_template_action" parent="eiru_base_menu.menu_producto" sequence="1"/>
               <menuitem name="Registrar categorías" id="product.menu_products_category" parent="eiru_base_menu.menu_producto" sequence="2"/>
               <menuitem name="Registrar marcas" id="product_brand.menu_product_brand" parent="eiru_base_menu.menu_producto" sequence="3"/>
@@ -29,7 +29,7 @@
               <menuitem name="Registrar valores de atributo" id="product.menu_variants_action" parent="eiru_base_menu.menu_producto" sequence="5"/>
 
         <!-- Finanzas -->
-        <menuitem name="Finanzas" id="eiru_base_menu.menu_finanzas" parent="menu_registrations" sequence="3"/>
+        <menuitem name="Finanzas" id="eiru_base_menu.menu_finanzas" parent="menu_registrations" sequence="40"/>
               <menuitem name="Objetivos del dashboard" id="eiru_reports_dashboard.dashboard_objetive_parent_menu" parent="eiru_base_menu.menu_finanzas"/>
 
     </data>

+ 0 - 6
views/webclient_templates.xml

@@ -6,13 +6,7 @@
         <template id="assets_backend5" name="eiru_base_menu assets" inherit_id="web.assets_backend">
             <xpath expr="." position="inside">
                 <link rel="stylesheet" href="/eiru_base_menu/static/src/css/advance_nav.css"/>
-                <link rel="stylesheet" href="/eiru_base_menu/static/src/css/smart-dropdown-menu-dev.css"/>
-                <link rel="stylesheet" href="/eiru_base_menu/static/src/css/smart-dropdown-menu.css"/>
-
                 <script type="text/javascript" src="/eiru_base_menu/static/src/js/advance_nav.js"></script>
-                <script type="text/javascript" src="/eiru_base_menu/static/src/js/smart-dropdown-menu.js"></script>
-                <script type="text/javascript" src="/eiru_base_menu/static/src/js/smart-dropdown-menu.min.js"></script>
-
             </xpath>
         </template>
 

Some files were not shown because too many files changed in this diff