Skip to content

Commit 44f8c8d

Browse files
committed
features update
1 parent e9e69c9 commit 44f8c8d

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Editor configuration, see https://editorconfig.org
2+
[*]
3+
charset = utf-8
4+
end_of_line = lf
5+
indent_style = space
6+
indent_size = 2

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"quoteProps": "consistent"
5+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "popover-plugin",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "A javascript plugin for popover",
55
"scripts": {
66
"start": "webpack --mode development --watch",

src/popover.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export class PopoverComponent {
277277
$ele.popComp = this;
278278
$ele.show = PopoverComponent.showMethod;
279279
$ele.hide = PopoverComponent.hideMethod;
280+
$ele.updatePosition = PopoverComponent.updatePositionMethod;
280281

281282
DomUtils.addClass(this.$ele, 'pop-comp-ele');
282283
DomUtils.addClass(this.$popover, 'pop-comp-wrapper');
@@ -491,11 +492,15 @@ export class PopoverComponent {
491492
}
492493

493494
static showMethod() {
494-
return this.popComp.show();
495+
this.popComp.show();
495496
}
496497

497498
static hideMethod() {
498-
return this.popComp.hide();
499+
this.popComp.hide();
500+
}
501+
502+
static updatePositionMethod() {
503+
this.popComp.popper.updatePosition();
499504
}
500505
/** static methods - end */
501506
}

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ const webpack = require('webpack');
33
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
44
const TerserPlugin = require('terser-webpack-plugin');
55
const FileManagerPlugin = require('filemanager-webpack-plugin');
6+
const { version } = require('./package.json');
67

7-
const banner = `Popover v1.0.6
8+
const banner = `Popover v${version}
89
https://sa-si-dev.github.io/popover
910
Licensed under MIT (https://github.com/sa-si-dev/popover/blob/master/LICENSE)`;
1011

0 commit comments

Comments
 (0)