@lemonadejs/contextmenu 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -72,9 +72,10 @@ if (! Modal && typeof (require) === 'function') {
72
72
 
73
73
  /**
74
74
  * Open submenu handler
75
- * @param s
75
+ * @param {object} s
76
+ * @param {boolean} cursor - Activate the first item
76
77
  */
77
- self.open = function(s) {
78
+ self.open = function(s, cursor) {
78
79
  if (s.submenu) {
79
80
  // Get the modal in the container of modals
80
81
  let item = self.parent.modals[index+1];
@@ -100,10 +101,14 @@ if (! Modal && typeof (require) === 'function') {
100
101
  // Define the position
101
102
  modal.top = parent.top + s.el.offsetTop + 2;
102
103
  modal.left = parent.left + 248;
103
- // Place cursor in the first position
104
- modal.options[0].cursor = true;
105
- // Position cursor
106
- modal.cursor = 0;
104
+
105
+ // Activate the cursor
106
+ if (cursor === true) {
107
+ // Place cursor in the first position
108
+ modal.options[0].cursor = true;
109
+ // Position cursor
110
+ modal.cursor = 0;
111
+ }
107
112
  } else {
108
113
  // Close modals with higher level
109
114
  self.parent.close(index+1);
@@ -226,7 +231,7 @@ if (! Modal && typeof (require) === 'function') {
226
231
  if (typeof(item) !== 'undefined') {
227
232
  // Open submenu in case that exists
228
233
  if (item.submenu) {
229
- this.parent.open(item);
234
+ this.parent.open(item, true);
230
235
  return true;
231
236
  }
232
237
  }
package/dist/style.css CHANGED
@@ -3,7 +3,7 @@
3
3
  user-select: none;
4
4
  border: 1px solid transparent;
5
5
  border-radius: 4px;
6
- box-shadow: 0 2px 6px 2px rgba(60,64,67,.15);
6
+ box-shadow: 0 2px 6px 2px rgba(60,64,67,.2);
7
7
  max-height: 300px;
8
8
  overflow-y: auto;
9
9
 
@@ -53,6 +53,8 @@
53
53
 
54
54
  .lm-menu-submenu > div.lm-menu-item div {
55
55
  margin-right: 5px;
56
+ font-size: 0.9em;
57
+ color: #888;
56
58
  }
57
59
 
58
60
  .lm-menu-submenu > div.lm-menu-item[data-submenu="true"]::after {
@@ -82,5 +84,4 @@
82
84
  position: absolute;
83
85
  left: 9px;
84
86
  line-height: 24px;
85
- transform: rotate(0.03deg);
86
87
  }
package/package.json CHANGED
@@ -19,5 +19,5 @@
19
19
  },
20
20
  "main": "dist/index.js",
21
21
  "types": "dist/index.d.ts",
22
- "version": "1.0.6"
22
+ "version": "1.0.7"
23
23
  }