Skip to content

Commit a3b6de6

Browse files
authored
Merge pull request #578 from RabotaRu/v3.13.2
v3.13.2
2 parents 60d2c9a + 7bd2200 commit a3b6de6

File tree

6 files changed

+23
-29
lines changed

6 files changed

+23
-29
lines changed
Binary file not shown.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/documentation/docs/conception/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DocHub - инструмент описания архитектуры через
99
3. [Управление архитектурой холдинга (экосистем)](#ecosystem);
1010
4. [Создание архитектурных фасадов](#facade).
1111

12+
1213
![](@anchor/versions)
1314
## 1. Управление версиями архитектуры
1415
![>Управление версиями](@document/dochub.archver)

public/documentation/docs/welcome.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/frontend/components/Docs/DocMarkdown.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
tocShow: {
112112
type: Boolean,
113113
default: true
114+
},
115+
inline: {
116+
type: Boolean,
117+
default: true
114118
}
115119
},
116120
data() {
@@ -177,7 +181,7 @@
177181
tocRendered(tocHTML) {
178182
// Не выводим оглавление, если в нем всего три раздела или меньше
179183
// eslint-disable-next-line no-useless-escape
180-
if (this.tocShow && ((tocHTML.match(/\<li\>.*\<\/li\>/g) || []).length > 3))
184+
if (!this.inline && this.tocShow && ((tocHTML.match(/\<li\>.*\<\/li\>/g) || []).length > 3))
181185
this.toc = tocHTML;
182186
},
183187
prepareMarkdown(content) {

src/frontend/components/Schema/PlantUML.vue

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
],
118118
data() {
119119
return {
120-
original: null,
121120
menu: { // Контекстное меню
122121
show: false, // Признак отображения
123122
x : 0, // Позиция x
@@ -145,18 +144,21 @@
145144
return this.svgEl;
146145
},
147146
viewBox() {
148-
if (!this.svgEl) {
149-
return {
150-
x: 0,
151-
y : 0,
152-
width : 0,
153-
height : 0
154-
};
155-
} else
156-
return this.cacheViewBox ?
157-
this.cacheViewBox
158-
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
159-
: this.cacheViewBox = this.svgEl.viewBox.baseVal;
147+
if (this.cacheViewBox) return this.cacheViewBox;
148+
let result = null;
149+
if (navigator.userAgent.toLowerCase().includes('firefox')) {
150+
// eslint-disable-next-line no-useless-escape
151+
const regex = /<svg.*?viewBox=\"(-?(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?)\s*(-?(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?)\s*(-?(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?)\s*(-?(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?)\".*?>/;
152+
const parsed = this.svg.match(regex);
153+
parsed && (result = {
154+
x: Number.parseFloat(parsed[1]),
155+
y: Number.parseFloat(parsed[2]),
156+
width: Number.parseFloat(parsed[3]),
157+
height: Number.parseFloat(parsed[4])
158+
});
159+
} else if (this.svgEl) result = this.svgEl.viewBox.baseVal;
160+
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
161+
return result ? (this.cacheViewBox = result) : { x:0, y:0, width:0, height:0 };
160162
},
161163
menuItems() {
162164
const result = [].concat(this.contextMenu);
@@ -206,6 +208,7 @@
206208
},
207209
doResize() {
208210
if (!this.svgEl || !this.svgEl.clientWidth || !this.svgEl.clientHeight) return;
211+
209212
const originWidth = this.viewBox.width;
210213
211214
if (this.$el.clientWidth > this.viewBox.width) {
@@ -227,17 +230,6 @@
227230
this.viewBox.x -= offsetX;
228231
this.viewBox.y -= offsetY > 0 ? offsetY : 0;
229232
},
230-
saveOriginal() {
231-
const originalHeight = this.viewBox.height * (this.svgEl.clientWidth / this.viewBox.width);
232-
this.original = {
233-
height: originalHeight,
234-
viewBoxHeight: this.$el.clientHeight * this.viewBox.height / originalHeight
235-
};
236-
},
237-
resetToDefault() {
238-
this.viewBox.height = this.original.viewBoxHeight;
239-
this.svgEl.style.height = this.original.height;
240-
},
241233
prepareSVG() {
242234
this.svgEl = this.$el.querySelectorAll('svg')[0];
243235
this.cacheViewBox = null;

0 commit comments

Comments
 (0)