diff --git a/api-generator/build-apidoc.js b/api-generator/build-apidoc.js index 00d5490d4..46df64a5e 100644 --- a/api-generator/build-apidoc.js +++ b/api-generator/build-apidoc.js @@ -358,6 +358,10 @@ if (project) { .map((s) => { if (s.text.indexOf('[here]') > -1) { return `${s.text.slice(0, s.text.indexOf('[here]'))} here ${s.text.slice(s.text.indexOf(')') + 1)}`; + } else if (s.text.indexOf('[MDN Reference]') > -1) { + return `${s.text.slice(0, s.text.indexOf('[MDN Reference]'))} MDN Reference ${s.text.slice( + s.text.indexOf(')') + 1 + )}`; } return s.text || ''; diff --git a/components/lib/scrollpanel/ScrollPanel.vue b/components/lib/scrollpanel/ScrollPanel.vue index b92c6bc28..710bb1666 100644 --- a/components/lib/scrollpanel/ScrollPanel.vue +++ b/components/lib/scrollpanel/ScrollPanel.vue @@ -103,39 +103,41 @@ export default { } }, moveBar() { - /* horizontal scroll */ - let totalWidth = this.$refs.content.scrollWidth; - let ownWidth = this.$refs.content.clientWidth; - let bottom = (this.$el.clientHeight - this.$refs.xBar.clientHeight) * -1; + if (this.$refs.content) { + /* horizontal scroll */ + let totalWidth = this.$refs.content.scrollWidth; + let ownWidth = this.$refs.content.clientWidth; + let bottom = (this.$el.clientHeight - this.$refs.xBar.clientHeight) * -1; - this.scrollXRatio = ownWidth / totalWidth; + this.scrollXRatio = ownWidth / totalWidth; - /* vertical scroll */ - let totalHeight = this.$refs.content.scrollHeight; - let ownHeight = this.$refs.content.clientHeight; - let right = (this.$el.clientWidth - this.$refs.yBar.clientWidth) * -1; + /* vertical scroll */ + let totalHeight = this.$refs.content.scrollHeight; + let ownHeight = this.$refs.content.clientHeight; + let right = (this.$el.clientWidth - this.$refs.yBar.clientWidth) * -1; - this.scrollYRatio = ownHeight / totalHeight; + this.scrollYRatio = ownHeight / totalHeight; - this.frame = this.requestAnimationFrame(() => { - if (this.scrollXRatio >= 1) { - this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'true'); - !this.isUnstyled && DomHandler.addClass(this.$refs.xBar, 'p-scrollpanel-hidden'); - } else { - this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'false'); - !this.isUnstyled && DomHandler.removeClass(this.$refs.xBar, 'p-scrollpanel-hidden'); - this.$refs.xBar.style.cssText = 'width:' + Math.max(this.scrollXRatio * 100, 10) + '%; left:' + (this.$refs.content.scrollLeft / totalWidth) * 100 + '%;bottom:' + bottom + 'px;'; - } + this.frame = this.requestAnimationFrame(() => { + if (this.scrollXRatio >= 1) { + this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'true'); + !this.isUnstyled && DomHandler.addClass(this.$refs.xBar, 'p-scrollpanel-hidden'); + } else { + this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'false'); + !this.isUnstyled && DomHandler.removeClass(this.$refs.xBar, 'p-scrollpanel-hidden'); + this.$refs.xBar.style.cssText = 'width:' + Math.max(this.scrollXRatio * 100, 10) + '%; left:' + (this.$refs.content.scrollLeft / totalWidth) * 100 + '%;bottom:' + bottom + 'px;'; + } - if (this.scrollYRatio >= 1) { - this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'true'); - !this.isUnstyled && DomHandler.addClass(this.$refs.yBar, 'p-scrollpanel-hidden'); - } else { - this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'false'); - !this.isUnstyled && DomHandler.removeClass(this.$refs.yBar, 'p-scrollpanel-hidden'); - this.$refs.yBar.style.cssText = 'height:' + Math.max(this.scrollYRatio * 100, 10) + '%; top: calc(' + (this.$refs.content.scrollTop / totalHeight) * 100 + '% - ' + this.$refs.xBar.clientHeight + 'px);right:' + right + 'px;'; - } - }); + if (this.scrollYRatio >= 1) { + this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'true'); + !this.isUnstyled && DomHandler.addClass(this.$refs.yBar, 'p-scrollpanel-hidden'); + } else { + this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'false'); + !this.isUnstyled && DomHandler.removeClass(this.$refs.yBar, 'p-scrollpanel-hidden'); + this.$refs.yBar.style.cssText = 'height:' + Math.max(this.scrollYRatio * 100, 10) + '%; top: calc(' + (this.$refs.content.scrollTop / totalHeight) * 100 + '% - ' + this.$refs.xBar.clientHeight + 'px);right:' + right + 'px;'; + } + }); + } }, onYBarMouseDown(e) { this.isYBarClicked = true; diff --git a/doc/common/apidoc/index.json b/doc/common/apidoc/index.json index 391da3120..0866e3efe 100644 --- a/doc/common/apidoc/index.json +++ b/doc/common/apidoc/index.json @@ -882,7 +882,7 @@ "readonly": false, "type": "null | Element | Document", "default": "", - "description": "Specifies the `root` option of the IntersectionObserver API\n[MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/root)" + "description": "Specifies the `root` option of the IntersectionObserver API\n MDN Reference " }, { "name": "rootMargin", @@ -890,7 +890,7 @@ "readonly": false, "type": "string", "default": "", - "description": "Specifies the `rootMargin` option of the IntersectionObserver API\n[MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/rootMargin)" + "description": "Specifies the `rootMargin` option of the IntersectionObserver API\n MDN Reference " }, { "name": "threshold", @@ -898,7 +898,7 @@ "readonly": false, "type": "readonly number[]", "default": "", - "description": "Specifies the `threshold` option of the IntersectionObserver API\n[MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/thresholds)" + "description": "Specifies the `threshold` option of the IntersectionObserver API\n MDN Reference " }, { "name": "animateOnLoad", diff --git a/doc/datatable/edit/CellEditDoc.vue b/doc/datatable/edit/CellEditDoc.vue index da5f45cbc..f7c3b6f4c 100644 --- a/doc/datatable/edit/CellEditDoc.vue +++ b/doc/datatable/edit/CellEditDoc.vue @@ -49,10 +49,7 @@ export default { ], code: { basic: ` - - - - - - +