not-bulma 1.0.49 → 1.0.51
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/package.json
CHANGED
package/src/frame/common.js
CHANGED
|
@@ -467,7 +467,7 @@ class notCommon {
|
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
static strLengthCap(str, MAX_TITLE_LENGTH = 50, POST_FIX = "...") {
|
|
470
|
-
if (str.length > MAX_TITLE_LENGTH) {
|
|
470
|
+
if (typeof str === "string" && str.length > MAX_TITLE_LENGTH) {
|
|
471
471
|
return str.substr(0, MAX_TITLE_LENGTH) + POST_FIX;
|
|
472
472
|
} else {
|
|
473
473
|
return str;
|
|
@@ -12,7 +12,7 @@ class notSideMenu extends Menu {
|
|
|
12
12
|
section: "any",
|
|
13
13
|
sectionTitle: "Меню",
|
|
14
14
|
priority: 0,
|
|
15
|
-
open:
|
|
15
|
+
open: true,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
static options = {
|
|
@@ -22,9 +22,11 @@ class notSideMenu extends Menu {
|
|
|
22
22
|
targetSelector: `#${TYPE}-menu`,
|
|
23
23
|
toggleSelector: `.${TYPE}-menu-toggle`,
|
|
24
24
|
root: "/",
|
|
25
|
-
open:
|
|
25
|
+
open: true,
|
|
26
26
|
navigate: (urls) => {
|
|
27
|
-
this.
|
|
27
|
+
if (this.isTouch()) {
|
|
28
|
+
this.hide();
|
|
29
|
+
}
|
|
28
30
|
if (!this.isDirectNavigation() && this.app) {
|
|
29
31
|
let func = this.app.getWorking("router");
|
|
30
32
|
if (func) {
|
|
@@ -109,10 +111,12 @@ class notSideMenu extends Menu {
|
|
|
109
111
|
this.resizeAsideAndMain(this.aside, this.main, this.nav);
|
|
110
112
|
this.resizeMain(this.main, this.aside);
|
|
111
113
|
window.addEventListener("resize", this.resizeMain.bind(this));
|
|
112
|
-
if (this.
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
if (this.isTouch()) {
|
|
115
|
+
if (this.getOptions().open) {
|
|
116
|
+
this.show();
|
|
117
|
+
} else {
|
|
118
|
+
this.hide();
|
|
119
|
+
}
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
|
|
@@ -192,7 +196,11 @@ class notSideMenu extends Menu {
|
|
|
192
196
|
|
|
193
197
|
static isOpen() {
|
|
194
198
|
if (this.aside) {
|
|
195
|
-
|
|
199
|
+
if (this.isTouch()) {
|
|
200
|
+
return this.aside.classList.contains("is-active");
|
|
201
|
+
} else {
|
|
202
|
+
return !this.aside.classList.contains("is-closed");
|
|
203
|
+
}
|
|
196
204
|
} else {
|
|
197
205
|
return true;
|
|
198
206
|
}
|